Guys I want to know if there are both the sims available and active in android dual sim phones irrespective of the device OS. I have already checked for few links that gives the result if the device is dual sim or not. But what I want to know is if there are two sim's installed in an android device. Please help me with a code snipnnet
Asked
Active
Viewed 2,703 times
0
-
https://stackoverflow.com/questions/3981007/how-can-i-check-whether-the-sim-card-is-available-in-an-android-device – jagapathi Jun 08 '17 at 06:37
-
Above link will check for primary sim state only – Gautami Bhandary Jun 08 '17 at 07:15
2 Answers
0
Before API 22 you cannot detect if both the sims are present or not, though you can only check for single sim presence with TelephonyManager
class in Android check more on DOCS and here is code snippet as well from similar answered SO question
From Android API 22
getActiveSubscriptionInfoList
will get the SubscriptionInfo(s)
of the currently inserted SIM(s). The records will be sorted by getSimSlotIndex() then by getSubscriptionId(). as mentioned on Android Docs

warl0ck
- 3,356
- 4
- 27
- 57
-
-
1I am afraid that you can't unless device manufacturer gives to access to their SDK, see similar answer https://stackoverflow.com/questions/7996197/detect-the-status-of-two-sim-cards-in-a-dual-sim-android-phone – warl0ck Jun 08 '17 at 07:29
-
yo got the status for dual sim on phone on devices with api level below 22 care to share how ? – warl0ck Jun 08 '17 at 10:41
-
I tried this : ` boolean isDualSimInstalled = false; TelephonyInfo telephonyInfo = TelephonyInfo.getInstance(cordova.getActivity()); if (telephonyInfo.isSIM1Ready() && telephonyInfo.isSIM2Ready()) { isDualSimInstalled = true; }` – Gautami Bhandary Jun 08 '17 at 11:11
0
Since api 22 there is getActiveSubscriptionInfoList() method you can call.

Jan Slominski
- 2,968
- 4
- 35
- 61
-
-
@GautamiBhandary Check answer for this question: https://stackoverflow.com/questions/14517338/android-check-whether-the-phone-is-dual-sim – Jan Slominski Jun 08 '17 at 07:20