在Android11上获取IMEI号等设备信息需要android.permission.READ_PRIVILEGED_PHONE_STATE权限,而这个权限又只授予系统级应用。项目中如果targetSdkVersion值小于29获取到的是null,大于28报SecurityException错误。 1.获取ICCID public String getICCID(Context context) { TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String simSerialNumber = telephonyManager.getSimSerialNumber(); return simSerialNumber; } 或者 public static String getICCID(Context context) { String iccid; TelephonyManager tm = (TelephonyManager)...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile