When developing an app that requires me to uniquely identify phone users. I was hoping for some advice on whether it is best to use a phone's UDID or IMEI. Are there any advantages/disadvantages to using either. All comments would be greatly appreciated
2 Answers
Pros of ANDROID_ID:
- Settings.Secure.ANDROID_ID. This is a 64-bit quantity that is generated and stored when the device first boots (
ANDROID_IDis not unique for android 2.2 and from 4.2)
Cons of ANDROID_ID:
ANDROID_IDcan change on factory reset.ANDROID_IDcan benullIt can be easily changed on a rooted phone
Several devices by several manufacturers are affected by the
ANDROID_IDbug in 2.2 and all of them have the sameANDROID_ID, which is 9774d56d682e549c. Which is also the same device id reported by the emulatorDocs: http://android-developers.blogspot.in/2011/03/identifying-app-installations.html
ANDROID_IDno longer uniquely identifies a device: https://stackoverflow.com/a/13465373/150016
Pros of IMEI
- IMEI number is always unique.
Cons of IMEI
- Many device don't have IMEI number i.e Samsung galaxy tab 2
Important Links
- 1
- 1
- 5,971
- 5
- 42
- 69
If you want to identify a device you should try UUID
http://developer.android.com/reference/java/util/UUID.html
or maybe try your own identifier. I used a MD5 over the IDs and the MAC-Address, combined with the devices System-Nano-Time. It realy would be a big coincident if two devices have the same "unique ID".
- 320
- 2
- 14