L
L
loly2016-06-09 08:19:00
Android
loly, 2016-06-09 08:19:00

A few questions regarding the behavior of the unique android device id?

This is how I get the unique device ID:

String android_id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);

Questions:
1) If the user logs in from another device, but under the same account and in the same application, will a new unique number be issued?
2) Will the unique identifier change if this code is called 2 times in a row (yes, I can check it myself, but maybe there are exceptions?)? If yes, in what cases?
3) If the user uninstalls the app and then installs it again a month later, will the ID stay the same?
I am probably missing a huge number of possible situations, so I will be grateful for tips on any pitfalls using this method.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2016-06-09
@loly

1 Yes
2 No
3 Yes
This is how it is generated
https://android.googlesource.com/platform/framewor...

L
lazard105, 2016-06-14
@lazard105

This method is useless because this field is not unique to the phone.
Often, manufacturers release a line of phones with a single ANDROID_ID.
For example, all "Motorolla Droid2" ANDROID_ID = 9774d56d682e549c
This was written on Android developers

ANDROID_ID seems a good choice for a unique device identifier. There are downsides: First, it is not 100% reliable on releases of Android prior to 2.2 (“Froyo”). Also, there has been at least one widely-observed bug in a popular handset from a major manufacturer, where every instance has the same ANDROID_ID.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question