Is there any ID kinda thing on an Android smartphone which is on every device unique? I want to store feedback, which the users sent me to my server, device specific. So the user can see if I fixed the bug they reported or if I implemented their idea.
Asked
Active
Viewed 67 times
2 Answers
1
You can get unique device id using::
private String android_id = Secure.getString(getContext().getContentResolver(),
Secure.ANDROID_ID);

Aditya Vyas-Lakhan
- 13,409
- 16
- 61
- 96

Punithapriya
- 131
- 9
-
Thanks, that helped very much! – SomeRandomNameCuzWhyNot Jul 18 '16 at 06:33
-
Welcome. Happy Coding!! – Punithapriya Jul 18 '16 at 06:36
0
Device Id is unique for every Device
public String getDeviceUniqueID(){
String DeviceId = "";
TelephonyManager mTelephony = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
//if your device contains sim slot
if (mTelephony.getDeviceId() != null){
DeviceId = mTelephony.getDeviceId();
}else{
// if your device not having a sim slot
DeviceId = Secure.getString(getApplicationContext().getContentResolver(), Secure.ANDROID_ID);
}
return DeviceId;
}

Android Surya
- 544
- 3
- 17