0

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

2 Answers2

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
  • Yes.But I want to check for below API 22 devices too – Gautami Bhandary Jun 08 '17 at 07:14
  • 1
    I 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