0

The answer was simple till the Android 11 version. The answer was 'get MAC address by using the following command'

List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());

After the new MAC address availability changes mentioned here;

https://developer.android.com/training/articles/user-data-ids#mac-11-plus

I can not get the MAC address on a device(I use Android TV devices) which version is 11 or higher. Now I am looking for a new global id for Android Device specific(TVs, tablets, or phones). The id should never change even if the device goes factory reset. How can I achieve that ?

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
SayMyName
  • 461
  • 5
  • 17
  • The problem with your solution is that you'll not be able to publish your app if you don't target at least Android 30 (see https://developer.android.com/google/play/requirements/target-sdk) But in any case, you should post any solution as an answer, not an edit in the question. – Adinia Mar 14 '22 at 16:08
  • You mean I can't publish my application on the google play store if I set targetSdkVersion lower than 30 right? – SayMyName Mar 14 '22 at 16:53
  • Yes, that's right, unfortunately. – Adinia Mar 15 '22 at 08:47
  • 1
    Please do not edit solution announcements into the question. Accept (i.e. click the "tick" next to it) one of the existing answer, if there are any. You can also create your own answer, and even accept it, if your solution is not yet covered by an existing answer. Compare https://stackoverflow.com/help/self-answer – Yunnosch Mar 15 '22 at 08:55
  • Similar [Is there a unique Android device ID?](https://stackoverflow.com/a/59093659) – Adinia Mar 15 '22 at 11:06

0 Answers0