How do we get Unique Device ID from the Android Tablets (Android 3.0 SDK HoneyComb)?
I have also found that we can get Android Device ID which is unique by using: String deviceId = Settings.System.getString(getContentResolver(), Settings.System.ANDROID_ID);
But Here its written that Although, it is not guaranteed that the Android ID will be an unique identifier.
.
I have also gone through the some SO Questions:
And also referred this article: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html.
But i am confused how do we get/have Unique Device ID from the Android Tablet type of Device?
TelephonyManager telephonyManager;telephonyManager = (TelephonyManager) getSystemService(Context. * getDeviceId() returns the unique device ID. * For example,the IMEI for GSM and the MEID or ESN for CDMA phones.
Method 1: Find Android device ID using dial pad codeOpen 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.
On Android, the device ID is the Android Advertising ID (AAID). Users are able to access their AAID within the settings menu under 'Google - Ads,' as well as reset the ID, and opt-out of ad personalization.
I know this question is old but it might through off somebody that finds it since android ID has no guarantee to work, it might even be null in some cases or easily changed on rooted phones.
What I did was combine the Android ID with the WiFi MAC address in a method that generates a UUID:
private void generateDeviceId() {
final String macAddr, androidId;
WifiManager wifiMan = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInf = wifiMan.getConnectionInfo();
macAddr = wifiInf.getMacAddress();
androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), macAddr.hashCode());
// Maybe save this: deviceUuid.toString()); to the preferences.
}
Dont forget to add the permissions to the AndroidManifest.
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Good luck!
Starting with Android 2.2, ANDROID_ID is pretty much guaranteed to be unique.
There was an article about that on the Android developer blog very recently.
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