//Fields
String myID;
int myversion = 0;
myversion = Integer.valueOf(android.os.Build.VERSION.SDK);
if (myversion < 23) {
TelephonyManager mngr = (TelephonyManager)
getSystemService(Context.TELEPHONY_SERVICE);
myID= mngr.getDeviceId();
}
else
{
myID =
Settings.Secure.getString(getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
}
Yes, Secure.ANDROID_ID is unique for each device.