Question

We've developed an app that needs to identify every device uniquely. We first thought of using IMEI and we're obtaining it using the TelefonyManager's getDeviceId() method.

But one user reported that the app doesn't work and it seems we weren't able to get the IMEI. I read here that some Nexus 7 don't have an IMEI, that they use another way for serial number: CSSN. How can I obtain it? Or, even better, is there a preferable way to uniquely identify every android device?

PS: We do have one Nexus 7 here for testing and it works perfectly, that's why before I said some Nexus 7.

Was it helpful?

Solution 2

Try the below code to get the device serial number :

Log.i("TAG","android.os.Build.SERIAL: " + Build.SERIAL);

You may go through the Android Documentation.

OTHER TIPS

It's recommended to identify every installation instead of every device. There are indeed several ways of identifying device, for example, Mac address, IMEI, Serial Number, ANDROID_ID , however, due to different OS Versions, devices an vender implementations, none of these are truly reliable. Check this out.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top