问题描述
我想获得设备ID,这将是唯一的每个Android设备。我是presently开发一款平板设备。想要得到唯一的设备ID和存储的相应值...
I want to get the device id that will be unique for each Android device. I am presently developing for a Tablet device. Want to get unique device id and store the corresponding values...
所以,我想知道是否如果我使用TelephonyManager.getDeviceId(平板设备将返回一个值)... ???还是有其他的值是唯一的每个设备???
So, i want to know whether Tablet devices will return a value if i use TelephonyManager.getDeviceId()...???Or is there any other value that is unique for each device???
推荐答案
这是的没有的重复问题。事实证明,谷歌的CTS要求TelephonyManager的getPhoneType需要在没有和TelephonyManager的getDeviceId需要对非手机设备空。
This is not a duplicate question. As it turns out, Google's CTS require that getPhoneType of TelephonyManager needs to be none and getDeviceId of TelephonyManager needs to be null for non-phone devices.
因此,要获得IMEI,请尝试使用:
So to get IMEI, please try to use:
String imei = SystemProperties.get("ro.gsm.imei")
不幸的是,SystemProperties是一个非公共类中的Android操作系统,这意味着它是不公开的常规应用。试看看这个帖子求助访问它:哪里是android.os.SystemProperties
这篇关于请问TelephonyManger.getDeviceId()返回的设备ID喜欢的Galaxy Tab平板电脑...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!