1

Android ID which we retrieve using Secure.getString(getContentResolver(), Secure.ANDROID_ID);

I would like to know what are the pros and cons using this ID as unique ID ? In few websites I read that its not reliable because ID may change when we do factory reset on our device or rooted users can change it. My point is when I do factory reset, Android ID was changing but when coming to Rooted user privilages I could not get any source to change. There are third party apps like DeviceMod, Android ID changer, none of them worked for me

If you folks know about please share your answers

GrIsHu
  • 29,068
  • 10
  • 64
  • 102
user1810931
  • 638
  • 2
  • 11
  • 33
  • You need to specify what you want to know about a given device if you want us to elaborate on what the pros and cons of AndroidID are in this regard. – class stacker Jan 24 '13 at 13:11
  • My question was not just for one device, it should be unique for all android devices. It may be phones, tablets, tv box or android stick – user1810931 Jan 24 '13 at 13:15
  • Sorry for not making myself clear. What I meant was: Do you intend to rely on the fact that a single device will only have one AndroidID over its lifetime? Do you intend to rely on the fact that there will not be another device with the same ID? (That's a difference.) Or something alse? – class stacker Jan 24 '13 at 13:22
  • I would like to know unique ID on all android devices, which I can use for hashing algorithm and do authorization to my app. – user1810931 Jan 24 '13 at 13:35
  • Are we talking about a paid-for app? Or is it more about protecting user data? Is there a server component? – class stacker Jan 24 '13 at 13:44
  • http://android-developers.blogspot.com/2011/03/identifying-app-installations.html – CommonsWare Jan 24 '13 at 13:53
  • My app starts on boot- up. So I am looking for some unique ID I can use and apply hasing algorithm and save it locally on my device so that before starting my app, if the ID matches then only my app will start or else it should not. Its kinda protecting against hackers. – user1810931 Jan 24 '13 at 13:55
  • @user1810931 By no means do I want to be disenchanting but unless you can perform your validation on a trusted server, a cracked version of your app will be available shortly after you have published it, given that it's interesting for those people who engage in Android cracking activities. Just my two cents but you shoulödn't have illusions wrt this. – class stacker Jan 24 '13 at 15:58

1 Answers1

1

You can find a good overview of identifying installations here and in this SO question.

Using ANDROID_ID is not reliable on pre Android 2.2 devices (might be null, ...). And there are devices that has the same ANDROID_ID set for all the devices. AFAIK, these devices had the problem: Droid 2, Samsung Galaxy Tab.

Another thing to point out is that each profile (introduced with Android 4.2) has its own ANDROID_ID (see this for details). But according to the docs, there should be one for all profiles (they already reported the bug).

Community
  • 1
  • 1
Tomik
  • 23,857
  • 8
  • 121
  • 100
  • Thank you.. My purpose is not just identifying installation but its providing security to APK. Before starting my app I should do some kind of validation If the cleint is authorized to use or not. SO for that I need to use some kind of hashing algorithms to hide data.In that process I should know what unique ID I can use – user1810931 Jan 24 '13 at 14:05