1

I want to get Sim serial number of both primary and secondary SIM.Currently I am using getSimSerialNumber() method.But using this method I am able to get only primary SIM serial number not secondary. I want serial number of both SIM. What is the solution for that?

Shekhar Jadhav
  • 1,035
  • 9
  • 20

2 Answers2

0

SubscriptionManager can be used for it but its cannot be used third party apps by Android 10 and SubscriptionManager Added in API level 22

// Requires, android.permission.READ_PHONE_STATE
SubscriptionManager sm = SubscriptionManager.from(mContext);

// it returns a list with a SubscriptionInfo instance for each simcard
// there is other methods to retrieve SubscriptionInfos List<SubscriptionInfo> 
sis = sm.getActiveSubscriptionInfoList();

// getting first SubscriptionInfo
SubscriptionInfo si = sis.get(0);
mani
  • 709
  • 6
  • 13
-1

You try below code

TelephonyManager tManager=(TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE);
String uid = tManager.getDeviceId();
Nasimxon
  • 132
  • 1
  • 7