Getting Device ID on Android

Posted by Grego on October 15, 2015

If you want to get a user’s hardware device id you can use the following, but beware: If the user factory resets the device, the device id will change

import android.provider.Settings.Secure;

// ...

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

Resources: How to get unique device hardware id in Android? [duplicate]