2

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 application 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

Bhabani Shankar
  • 1,267
  • 4
  • 22
  • 41
  • What about using phone number as unique identifier? http://stackoverflow.com/questions/4930424/how-to-get-the-phone-number-of-the-phone-in-android-code – Indrek Kõue Aug 22 '11 at 06:33
  • Check this below links, you will get an idea http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id http://stackoverflow.com/questions/3115918/android-unique-id – Naga Harish M Aug 22 '11 at 06:34
  • @Bhabani Shankar: Fetch the Device Id in which your app running and then create a web services and pass the device to Id to that WebService , check whether the device id is already in the database or not – Sankar Ganesh PMP Aug 22 '11 at 06:35
  • UUID is what you are looking for: http://stackoverflow.com/questions/5088474/how-can-i-get-the-uuid-of-my-android-phone-in-an-application – Daniel Pereira Aug 22 '11 at 06:35

3 Answers3

5

You should read this: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html

Romain Guy
  • 97,993
  • 18
  • 219
  • 200
1

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.

codenheim
  • 20,467
  • 1
  • 59
  • 80
0

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?

Community
  • 1
  • 1
bHaRaTh
  • 3,464
  • 4
  • 34
  • 32