通过使用以下方法,我将获得sim one的信息
TelephonyManager telephonyManager = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
// Get the SIM country ISO code
String simCountry = telephonyManager.getSimCountryIso();
Log.e("Show:", simCountry);
// Get the operator code of the active SIM (MCC + MNC)
String simOperatorCode = telephonyManager.getSimOperator();
Log.e("Show:", simOperatorCode);
// Get the name of the SIM operator
String simOperatorName = telephonyManager.getSimOperatorName();
Log.e("Show:", simOperatorName);
// Get the SIM’s serial number
String simSerial = telephonyManager.getSimSerialNumber();
Log.e("Show:", simSerial);
// Get the phone number
String mPhoneNumber = telephonyManager.getLine1Number();
Log.e("Show:", mPhoneNumber);
如何获取双卡手机的第二张SIM卡的信息?
// Get the phone number
String mPhoneNumber = telephonyManager.getLine1Number();
Log.e("Show:", mPhoneNumber);
在某些设备上工作
许可:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
那我该怎么办?有错误吗?
答案 0 :(得分:0)
来自Android API 22 SubscriptionMananger可用 你只需要打电话
SubscriptionManager.from(context).getActiveSubscriptionInfo(1)
获取有关第二张SIM卡的信息