2

I am working on an install referral in which need to avoid crediting users for multiple app installs. Settings.Secure.ANDROID_ID looks to solve the issue. In the below URL it is mentioned not to use hardware identifiers and need READ_PRIVILEGED_PHONE_STATE permission to use this

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

I am able to get the ANDROID_ID without asking any permission in Android 10 devices. Is Android_ID a hardware identifier ? Is there a mistake in this document.

I m aware that there are few devices which returns null and same value for all models. Apart from this is it safe to depend on this or it is gonna change in future,

OnDWay
  • 119
  • 4
  • 11
  • There is a method which sounds promising: `com.google.android.gms.analytics.Tracker.enableAdvertisingIdCollection()` https://developers.google.com/android/reference/com/google/android/gms/analytics/Tracker.html#enableAdvertisingIdCollection(boolean) . But regarding the decompiled source code of this `Tracker.class` in `play-services-analytics-impl:18.0.2`, there seems to be no more use for this flag. Also changes in the manifest don't result in changes of this flag. – user1185087 Apr 17 '23 at 12:07

1 Answers1

1

Given that all of Android's changes in this direction have been to eliminate the ability to track users across installs or between different apps, if you have found an id that allows you to expect it to removed/hidden/changed. In fact in the documentation it explicitly states:

Note: For apps that were installed prior to updating the device to a version of Android 8.0 (API level 26) or higher, the value of ANDROID_ID changes if the app is uninstalled and then reinstalled after the OTA.

So that's not going to work.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
  • 3
    Once updated to Android O, I guess the ANDROID_ID does not change across app installs. The point you pointed to seems to effect case where the app was already installed prior to Android O. Once device is upgraded to Android O, and the app is uninstalled and reinstalled, then it would give a new ANDROID_ID. https://android-developers.googleblog.com/2017/04/changes-to-device-identifiers-in.html – Dibzmania Jan 04 '20 at 23:09