如何找到的Andr​​oid设备的序列号?序列号、设备、Andr、oid

由网友(全球少女萌主)分享简介:我需要使用一个唯一的ID为Android应用程序,我想的序列号的设备将是一个不错的人选。我该如何找回我的应用程序的Andr​​oid设备的序列号?解决方案 TelephonyManager tManager =(TelephonyManager)myActivity.getSystemService(Contex...

我需要使用一个唯一的ID为Android应用程序,我想的序列号的设备将是一个不错的人选。我该如何找回我的应用程序的Andr​​oid设备的序列号?

解决方案

  TelephonyManager tManager =(TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE);
字符串的uid = tManager.getDeviceId();
 

getSystemService是从活动类中的方法。 getDeviceID()将返回该装置的MDN或MEID取决于哪个无线电电话使用(GSM或CDMA)。

每个设备必须回到这里独特的价值(假设它是一个电话)。这应该可以在任何Android设备的工作与SIM卡插槽和CDMA无线。你对你自己与搭载Android微波; - )

I need to use a unique ID for an Android app and I thought the serial number for the device would be a good candidate. How do I retrieve the serial number of an Android device in my app ?

解决方案

TelephonyManager tManager = (TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE);
String uid = tManager.getDeviceId();

getSystemService is a method from the Activity class. getDeviceID() will return the MDN or MEID of the device depending on which radio the phone uses (GSM or CDMA).

Each device MUST return a unique value here (assuming it's a phone). This should work for any Android device with a sim slot or CDMA radio. You're on your own with that Android powered microwave ;-)

阅读全文

相关推荐

最新文章