我在试着检索一个电话的IMEI号码。我使用的代码如下:
public static string GetDeviceId(Context context)
{
TelephonyManager telephonyMgr = context.GetSystemService(Context.TelephonyService) as TelephonyManager;
string deviceId = telephonyMgr.DeviceId == null ? "UNAVAILABLE" : telephonyMgr.DeviceId;
return deviceId;
}代码有什么问题吗?我还能做什么呢?
发布于 2013-03-16 18:04:46
您需要在清单文件中添加以下权限
<uses-permission android:name="android.permission.READ_PHONE_STATE" />https://stackoverflow.com/questions/15447937
复制相似问题