首先,AndroidManifest.xml 中添加一个权限:<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
其次,
private static String getIMIEStatus(Context context) { TelephonyManager tm = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); String deviceId = tm.getDeviceId(); return deviceId; }