1

Hello I am working on an application in which we are tracking our app installation using device unique ID.

We are doing right now like this as https://stackoverflow.com/a/2785493/2455259

private String android_id = Secure.getString(getContext().getContentResolver(),
                                                    Secure.ANDROID_ID); 

I got to know that from android 4.2 it can have different for different users https://stackoverflow.com/a/27013749/2455259.

Now I can't take mac address of wifi or bluetooth because it requires to make it turn on then fetch. Even I can't take IMEI because some tables don't have call feature so they don't have IMEI.

Now what are the option to uniquely identify android device ?

Community
  • 1
  • 1
N Sharma
  • 33,489
  • 95
  • 256
  • 444

2 Answers2

3

Now what are the option to uniquely identify android device ?

I am afraid assigning own unique number is most effective approach, because ANDROID_ID is broken (the answer you link to is incorrect - see comments there too), relying on it is quite futile as it can sometimes be the same for many devices or null, so anything but unique, therefore using it is pointless as it adds more troubles than helps. There's post on Android blog about this topic "Identifying App Installations" that you may want to get thru as well.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
0

I know this is old and the OP might have already moved on but with the introduction of Instance ID, we can use it to identify a unique installation.

The associated code is pretty straightforward too.

String iid = InstanceID.getInstance(context).getId();

The benefits include not having to specify permissions for Android Marshmallow and above. This seems to be a plus for developers who would need a unique id at the outset and cannot rely on user provided permission model for the same.

humblerookie
  • 4,717
  • 4
  • 25
  • 40