How to get Unique ID of Android version 6 to 14

156 Views Asked by At

I want some unique ID of the android device(Non resettable).

Basic Idea behind is we want to store the unique ID to the user account on server so that user can not login on different phone. If they use the different phone then we throw the error.

I tired the code lots of code

Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID); 

Also tried the FCM ID and Advertising ID.

but all the id's are changed like: If we use Secure.ANDROID_ID then its changes if user factory reset the phone. And FCM ID is changed if user Uninstall the app and reinstall it. And Advertising ID is changed if user reset the Google Ads id.

Is there any way to achieve the functionality?

Thanks in advance

0

There are 0 best solutions below