Как получить id с android 10?

как получить id с android 10? есть идеи?

what is your use case?
see also

I advice you to read the official blog of the best practice of google to see what the use case match with your specification : Best practices for unique identifiers  |  Android Developers


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

я использоваль component_method

in Android 10, Android identifiers have been restricted, see again Best practices for unique identifiers  |  Android Developers

taken from there

Best practices for working with Android identifiers

When working with Android identifiers, follow these best practices:

  1. Avoid using hardware identifiers. In most use cases, you can avoid using hardware identifiers, such as SSAID (Android ID), without limiting required functionality.Android 10 (API level 29) adds restrictions for non-resettable identifiers, which include both IMEI and serial number. Your app must be a device or profile owner app, have special carrier permissions, or have the READ_PRIVILEGED_PHONE_STATE privileged permission in order to access these identifiers.
  2. Only use an Advertising ID for user profiling or ads use cases. When using an Advertising ID, always respect users' selections regarding ad tracking. Also, ensure that the identifier cannot be connected to personally identifiable information (PII), and avoid bridging Advertising ID resets.
  3. Use an Instance ID or a privately stored GUID whenever possible for all other use cases, except for payment fraud prevention and telephony. For the vast majority of non-ads use cases, an Instance ID or GUID should be sufficient.
  4. Use APIs that are appropriate for your use case to minimize privacy risk. Use the DRM API for high-value content protection and the SafetyNet APIs for abuse protection. The SafetyNet APIs are the easiest way to determine whether a device is genuine without incurring privacy risk.

my guess is, the CellId method therefore does not work anymore in Android 10 (I can't test it, because I do not have such device)


Спасибо, большое!