Is {Settings.Secure.AndroidId} Field permanent?

fordicuso 41 Reputation points
2022-03-28T21:08:03.98+00:00

It says

"A 64-bit number (as a hex string) that is
randomly generated on the device's first boot and
should remain constant for the lifetime of the device".

My question is, does this number never change even when
user has upgraded Android's version?

Thanks.

p.s. The documentation for

Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId)

can be found in

https://learn.microsoft.com/en-us/dotnet/api/android.provider.settings.secure.androidid?view=xamarin-android-sdk-12
.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,366 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 77,406 Reputation points Microsoft Vendor
    2022-03-29T06:57:02.883+00:00

    Hello,​

    does this number never change even when user has upgraded Android's version?

    Android ID will not be changed.

    Open the source code that generate the Ssaid(Android ID) getSsaidSettingLocked based on two parameters: a random ID generated on first use to identify a user ID (in multi-users or work profiles), and the app's signing key. If you update android version, these parameters will not be changed.

    If user ID is randomized after a factory reset, the app-specific Android ID should be changed.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.