0

I am able to get operator name of sim in slot 1 by using:

TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
String carrierName = manager.getNetworkOperatorName();

Is there any method to find opertor name of sim in slot 2

vishal sharma
  • 319
  • 4
  • 15

1 Answers1

0

Since API version 22 its possible

try following code for device having os greater than android 5.2

List<SubscriptionInfo> subscriptionInfos = SubscriptionManager.from(getApplicationContext()).getActiveSubscriptionInfoList();
for(int i=0; i<subscriptionInfos.size();i++)
{
    SubscriptionInfo lsuSubscriptionInfo = subscriptionInfos.get(i);
    Log.d(TAG, "getNumber "+ lsuSubscriptionInfo.getNumber());
    Log.d(TAG, "network name : "+ lsuSubscriptionInfo.getCarrierName());
    Log.d(TAG, "getCountryIso "+ lsuSubscriptionInfo.getCountryIso());
}

for more information

Multiple sim support in android

CodingRat
  • 1,934
  • 3
  • 23
  • 43