Call through specified SIM from android

早过忘川 提交于 2019-12-21 20:26:23

问题


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?


回答1:


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.




回答2:


Use ACTION_DIAL to let people select their SIM.




回答3:


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



来源:https://stackoverflow.com/questions/14985992/call-through-specified-sim-from-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!