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?
Asked
Active
Viewed 638 times
1
-
I think this is covered by this answer https://stackoverflow.com/questions/13472951/get-both-sim-numbers-in-a-dual-sim-android-phone – Shai Almog Aug 18 '17 at 04:50
-
See the second answer – Shai Almog Aug 18 '17 at 12:09
2 Answers
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