2

I am currently using the android API

public static String get_IMSI_Number(Context context) {
    TelephonyManager tel = (TelephonyManager) context
            .getSystemService(Context.TELEPHONY_SERVICE);
    return tel.getSubscriberId();
}

to get the IMSI number.

But unfortunately it is not getting the IMSI number if the device is dual SIM and It is returning "null" always.

I want to get the IMSI number of the Device( For Dual SIM )

case 1: Need to read the IMSI numbers if the device inserted with two SIMS in it's two slots

case 2: Need to read the IMSI number if the device inserted with one SIM in it's first slot and second slot left unused/blank

case 3: Need to read the IMSI number if the device inserted with one SIM in it's second slot and first slot left unused/blank

I followed the link "Android : Check whether the phone is dual SIM" but not worked.

Can any one help me to sort it out.

Note:The solution should work in all android 4.0 and above versions and in all vendors(Samsung,motorola,HTC,Karbon etc).

Thanks in advance.

Community
  • 1
  • 1
Sharath
  • 315
  • 1
  • 3
  • 13
  • possible duplicate of [Android : Check whether the phone is dual SIM](http://stackoverflow.com/questions/14517338/android-check-whether-the-phone-is-dual-sim) Or at least, the top answer shows how to get the IMSIs. – TripeHound Jul 24 '15 at 12:39
  • But it is not working in motorola because the solution provided is vendor dependent but not plot-form level. – Sharath Jul 24 '15 at 13:18
  • From the little I've seen, before 5.1 there _wasn't_ a universal way of doing this. I assume you either have to live with "works sometimes" or start adding platform-specific code on a case-by-case basis. – TripeHound Jul 24 '15 at 13:22
  • yes I agree, but there are so many vendors provides dual SIM support and they might have changed the API for version to version and also knowing the what API thay have used..for that API what parameters need to pass(By using Java Reflection Mechanism) is complicated.So looking a common solution. – Sharath Jul 24 '15 at 13:31

0 Answers0