security - how to identify android mobile device uniqueid in xamarin android in c# -


for application, need trace users android device unique id, android devices give employees client , when use device open our application , type code. have check whether request came devices of our employees open app. if other people have app in phone though app not open. it's requirement client wants, googled lot found few links. tried not working

  public static string getdeviceandroidid(context context)   {       string android_id = secure.getstring(context.getcontentresolver(),     secure.android_id);       if(android_id != null)           return android_id;       else           return "";    } 

tried not getting "context . getcontentresolver()" need assistance thanks.

try android.provider namespace:

var android_id = android.provider.settings.secure.getstring(contentresolver, android.provider.settings.secure.androidid); 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -