1

In android version 4.0 or higher, is the bellow androidId completely unique?

androidId = android.provider.Settings.Secure.getString(getContentResolver(),android.provider.Settings.Secure.ANDROID_ID);
supermonkey
  • 631
  • 11
  • 25

1 Answers1

3

You didn't specify in what context you want the ID to be unique (is it app installations, devices, users, or something else?), so I am assuming you are just looking for a way to uniquely identify devices.

ANDROID_ID should be reliable on all devices running 2.2 (Froyo) and later. However, as this Android developers blog post explains, there has been at least one instance in which a manufacturer broke ANDROID_ID.

That blog post also explores a few other options for identifying devices (and why they aren't good options), and discusses why you probably don't actually need to identify unique devices. Generally identifying app installations is sufficient.

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
  • I mean I am looking for a way to uniquely identify devices in only my app. My app corresponds to android version 4.0 or higher. So you mean ANDROID_ID is enough in my condition? – supermonkey Jun 03 '15 at 17:45
  • For most devices, it will work. Like I mentioned, there as been an instance of a device manufacturer breaking it the past, so there is no 100% guarantee that it will work on all devices though. The only way to guarantee it is to build an app installation ID system yourself. – Bryan Herbst Jun 03 '15 at 18:08
  • Thank you for your reply. I understand. – supermonkey Jun 04 '15 at 05:06