0

I'm after some help - I've noticed that some Cambridge Scientific StarPADs have an IMEI clash when we check for Unique ID.

((TelephonyManager)paramContext.getSystemService("phone")).getDeviceId();

or

Settings.Secure.getString(paramContext.getContentResolver(), "android_id");

I'm at a bit of a loss, the supplier is claiming ignorance and it is discussed elsewhere Id Android Apps .. does anyone out there have any ideas?

BTW: Yes I've checked around for a similar question, but if I've missed something - happy to be corrected.

  • The first statement - should be unique, unless the manufacturer is doing something wrong? At least according to [Google](http://developer.android.com/reference/android/telephony/TelephonyManager.html#getDeviceId()) – Bobby Bob Jan 15 '16 at 10:36
  • Hi all - to further round out the confusion - it seems that the device certs aren't quite right. Some of the app's for "report root status" are claiming that the device has "test certs". Hmmm.... advice?? – Bobby Bob Jan 22 '16 at 23:57

1 Answers1

0

Because of Android fagmentation there is no Unique ID in Android at all.

If You really need it for backend use, you should create at backend side new ID while app first start and store it ex. in SharedPreferences.

If You want this key to persist between instalations problem is more complicated. You may store this key out of /data/data/ directory but it's a bit hacky method.

Another solution is to generate potential unique ID by getting as many id's from Your phone as You can get. WiFi mac address, Bluetooth mac address, device ID etc. and combine them but you can never be sure it will be unique globally.

Marek Multarzyński
  • 1,907
  • 1
  • 10
  • 6
  • Thanks - a good point, something we've toyed with is pushing everything back for a central hash, making sure it doesn't clash and returning it. It's the IMEI clash that I find really intriguing, it just [shouldn't](http://developer.android.com/reference/android/telephony/TelephonyManager.html#getDeviceId()) - or am I missing something? – Bobby Bob Jan 15 '16 at 10:33