1

Hi in my app i am checking whether the SIM-Card is present or not, now the issue is in dual SIM phone , primary master SIM slot is CDMA and doesn't contain any SIM where as the secondary SIM slot is GSM and contains the SIM .

since the below code is referring to master SIM slot control always goes to else part so how do i get access to slave SIM , Please help.

tm = (TelephonyManager)activity.getSystemService(Context.TELEPHONY_SERVICE);  
//gets the current TelephonyManager

if (tm.getSimState() != TelephonyManager.SIM_STATE_ABSENT){

      //the phone has a sim card

    } else {

      displayToast("Please insert sim card");

      finish();
    }
Pragnesh Ghoda シ
  • 8,318
  • 3
  • 25
  • 40
user2107111
  • 735
  • 1
  • 6
  • 10
  • Check this, may help you : http://stackoverflow.com/questions/14517338/android-check-whether-the-phone-is-dual-sim – VVB Jul 16 '14 at 10:32

1 Answers1

0

I think that the dual SIM API is not documented in android. So you will need to look the android source code =)

In this post (https://stackoverflow.com/a/17499889/3482000) you can find a way to get SIM IMEI for the first and second SIM using java reflection. You can use that to verify if the sim is available.

Community
  • 1
  • 1
Sandro Machado
  • 9,921
  • 4
  • 36
  • 57