i'm new to Adroid apps ecosystem. I built a simple app and notice there are two different ANDROID IDs (i'm runnig app in emulator)
- one stored in
/data/system/users/0/settings_secure.xml
file:
<setting id="25" name="android_id" value="9f43e4f495a6730" package="android" defaultValue="9f43e4f495a6730" defaultSysSet="true" />
- upon executing command
$adb shell settings get secure android_id
in Terminal ---> this is also one I get
- other stored under
/data/system/users/0/settings_ssaid.xml
<setting id="4" name="10153" value="35ea805581c66911" package="com.example.app_v1.demo.debug" defaultValue="35ea805581c66911" defaultSysSet="false" tag="null" />
<setting id="5" name="10154" value="35ea805581c66911" package="com.example.app_v2.full.debug" defaultValue="35ea805581c66911" defaultSysSet="false" tag="null" />
- upon executing statement in my app code:
Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID
---> this is the one I get - it looks this is also called SSAID..
Can someone share the
- purpose of having two different IDs? which one to use in which usecase? it's a bit confusing both are called ANDROID IDs despite stored at different locations (Is my understanding correct #1 is perhaps used by system / Andorid apps and #2 is to be used used by user, 3rd party app)
- also i find it odd that both my
app_v1
andapp_v2
output same ANDROID ID (35ea805581c66911). Is my understanding correct it's because post Android-O, this ANDROID ID is scoped by signing key and user as per https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID ?
Thanks for clarification in advance