Possible Duplicate:
Unique ID of Android device
AFAIK, the emei number, mac address can be change by some hacking work. I am in need to find an unique value on each device which can not replace, cannot edit. Is there any value?
Possible Duplicate:
Unique ID of Android device
AFAIK, the emei number, mac address can be change by some hacking work. I am in need to find an unique value on each device which can not replace, cannot edit. Is there any value?
Try this.
String android_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
NOTE: The emulator will return a NULL value so if you try to use this value in the emulator environment your application will crash.
For Mac OSX you can use the command line:
ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }'
For phones or devices that carry a sim card, you can rely on the ICCID which is basically the serial number of the SIM. I have unheard of ways to hack the ICCID, so you can probably trust it.
Android allows you to fectch the ICCID through: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getSimSerialNumber%28%29
Another option is the IMSI (corresponds to the subscription number), also available on android.