6

By using this below method i am getting information of 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);

how to get information of second sim of dual sim phone?

            // Get the phone number
            String mPhoneNumber = telephonyManager.getLine1Number();
            Log.e("Show:", mPhoneNumber);

work on some device

Permission:

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

So what should i do? Is there any Mistake?

Luca Nicoletti
  • 2,265
  • 2
  • 18
  • 32
Anil kumar
  • 87
  • 4

1 Answers1

0

From Android API 22 SubscriptionMananger is available You just need to call

SubscriptionManager.from(context).getActiveSubscriptionInfo(1)

to get info about second sim card

Dmitrijs
  • 1,333
  • 1
  • 14
  • 20