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.

有帮助吗?

解决方案 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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top