Updated 15 December 2016
Many of us needs a unique id of the device or user for many reasons, it may be to get individual installations or to give the user info of multiple logins from different devices. For all these reasons one must have to use a device specific unique identifier. There are many options of this but we are here talking about the two mostly used.
So here we will discuss the pros and cons of both the options. Its totally depends upon a persons need and usage to use one of them.
IMEI Number:
The imei number (International Mobile Equipment Identity) is a unique number thats mapped with every sim port of the device. You can see it on your devices battery and mainly used by the service providers. You can get it as
1 2 |
TelephonyManager manager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); manager.getDeviceId(); |
Pros:
Cons:
Android Id:
Its a 64-bit number randomly generates when the device firstly boots. Its a secure number and it didn’t change during the lifetime of a device. But change when the factory reset is done. You can get it as
1 |
String android_id = Secure.getString(this.getContentResolver(), Secure.ANDROID_ID); |
Pros:
Cons:
So thats all about the two, the use of any one depends upon your needs and whichever suits you better.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.