For my application, i need to trace the users android device unique id, android devices will be give to the employees by the client and when they use that device open our application and type some code. we have to check whether request came from the devices of our employees then only we will open the app. If other people have this app in their phone even though app will not open. It's a requirement which client wants, i googled it a lot found few links. Tried this but 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 this but not getting "context . getcontentresolver()" Need some assistance thanks.
This unique ID can be IMEI, MEID, ESN or IMSI. They can be defined as follows : IMEI for International Mobile Equipment Identity : the Unique Number to identify GSM, WCDMA mobile phones as well as some satellite phones.
Open your phone's dial pad, usually named “Phone” in the apps drawer. 2. Here dial this code *#*#8255#*#*. As soon as you will enter the last digit, Gtalk Service Monitor will open up and show your Android device ID along with your email.
For other devices, like Android, go to Settings and select "System". Next, tap About Phone. Look for your IMEI number listed here or tap Status for more info.
Try the Android.Provider
namespace:
var android_id = Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With