Unique identifier for each phone Android
I want to create an application where the application will ask user to register with user details while using the app for the first time. This information will be stored in a remote database. Next time when user opens the a开发者_运维问答pplication I want to identify the user from my database.
Now to implement this, I will have to find a unique identifier for each phone.
Could anyone let me know how to get unique identifier for each phone.
Regards,
Shannkar
You should read this: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html
The problem with using the phone number is phone numbers change, get recycled, etc. SIM cards change. Get swapped. Etc. I've had real production experience with this.
I've had good results having users enter their serial# or ESN.
Or use the IMEI. You should be able to access it via the API.
If you want it automated, and cannot access the ESN or IMEI, then generate a GUID and store it on persistent storage in the device.
You can use IMEI as the unique identification.you can get IMEI of android device in the following way
TelephonyManager tManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String uuid = tManager.getDeviceId();
check my similar question here to get IMEI (UUID) number How can I get the UUID of my Android phone in an application?
精彩评论