How to identify an Android device programmatically?
This question already has an answer here:
Your best bet with finding something unique about the Android device would be to access its serial number. There are several other posts on how to do this, but the most-viewed one is here:
How to find serial number of Android device?
You can identify any android mobile uniquely on basis of imei
.
TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.getDeviceId();
Add the permission into your AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
In emulator, you'll probably get a like a 0000... value. Check it on device to get device id.
链接地址: http://www.djcxy.com/p/24640.html上一篇: 如何唯一标识Android设备?
下一篇: 如何以编程方式识别Android设备?