Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Unique ID for device registry

I need to register every device that will install the apk so only authorised devices can login and also to identify if an user is logged in on more than one device.

First, I was thinking on some ID taken from the device such as the MAC Address. but I've been reading this Unique ID best practices and now I know now getting the MAC address is now deprecated, the devices won't necessarily have imei and I don't have an Advertising ID.

I tested "Settings.Secure.ANDROID_ID" and it won't return anything, I also tried "Build.SERIAL" and it gives me an ID but it also comes with a warning "Using SERIAL to get device identifiers is not recommended".

I know this could be a repeated question but I didn't see any real answers on other questions to this point, I'm targeting api 21 upwards.

So, is there a persistent and unique ID that I can use on api 21 upwards ?

Comments