Dinash
Dinash

Reputation: 3047

Call through specified SIM from android

I am wondering about the possibility of making a phone call from android through a selected SIM on a dual SIM android devices. Is it possible to select a particular SIM to call through programmatically?

Upvotes: 8

Views: 7744

Answers (5)

George
George

Reputation: 23

I was having the same problem and happened to walk through a solution at androidnoon and

intent.putExtra("com.android.phone.extra.slot", 0); // for sim 1 and '1' for sim2

worked well

Upvotes: 0

raghav
raghav

Reputation: 63

If the phone is dual sim and you want to make call from sim2 then use 1 if you want to use sim1 then use 0 in intent.putextra

 Intent intentcall = new Intent(Intent.ACTION_CALL);

 intentcall.putExtra("simSlot", 1);
 intentcall.setData(Uri.parse("tel:"+dialNumber));
 startActivity(intentcall);

Upvotes: 0

Nitin Karale
Nitin Karale

Reputation: 799

private void callBack(String phone, Context context) {
    Intent intent = new Intent(Intent.ACTION_CALL).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    //check wheather it is dual sim or not then

    //if sim 1
    intent.putExtra("simSlot", 0);

    //else if sim 2
    intent.putExtra("simSlot", 1); 

    intent.setData(Uri.parse("tel:" + phone));
    context.startActivity(intent);
}

Check it is dual sim or not, go through the bellow link

Android : Check whether the phone is dual SIM

Upvotes: 0

tsil
tsil

Reputation: 2069

Use ACTION_DIAL to let people select their SIM.

Upvotes: 1

Raghav Sood
Raghav Sood

Reputation: 82553

The Android SDK doesn't provide an APIs to control the SIM being used on dual SIM mobiles. In fact, Android doesn't even really support dual SIM phones. All dual SIM devices are modified extensively by the manufacturers.

You cannot control the SIM through the Android SDK. If any OEM provides such an API for their devices, I am not aware of it, but you can try asking the manufacturer of your dual SIM device directly is such an API exists on their device.

Upvotes: 4

Related Questions