Skip to content Skip to sidebar Skip to footer

Get Unique Device Id In Android

I would like to know how to get a String that uniquely identify the current device in android. I know this has been asked before but all the answers are the same: to use the ANDROI

Solution 1:

See the following post which describe the several ways to retrieve an Unique ID to identify Android devices..

https://medium.com/@ssaurel/how-to-retrieve-an-unique-id-to-identify-android-devices-c40080e04fa4

and refer to Android Developers Best Practices for Unique Identifiers to know which are recommended and which are not..

https://developer.android.com/training/articles/user-data-ids.html

Solution 2:

There is no ideal way. Best way is to generate one on your own and then reuse it till app is installed. You can use

StringuniqueId= UUID.randomUUID().toString(); 

Generate it the first time the app launches and save it in your shared preference for further use.. This will change after every new installation and hence you can track app installations as well.

Post a Comment for "Get Unique Device Id In Android"