如何在设置默认 SIM 卡的双 SIM 卡中在 android 中发送短信?

问题描述:

如何使用双卡在android中发送短信以进行广播而不是有意的??如何在android中检测双卡?用户想要选择 sim 发送短信广播.在 android 中设置默认 sim 用于在 android 中的双卡中发送 msg.用户必须选择特定的 SIM 卡才能发送短信.

How can send sms in android with dual sim for broadcast not intent?? How can detect dual sim in android? User wants to select sim for send sms broadcast. In android set the default sim for sending msg in dual sim in android. User have to select particular sim for sending sms.

如果 shell 命令 'service list' 的输出包含 'telephony.registry2',则手机有第二张 SIM 卡.如果包含telephony.registry3",则手机有第三张 SIM 卡,依此类推.

If the output of the shell command 'service list' contains 'telephony.registry2', then the phone has a second SIM card. If contains 'telephony.registry3', then phone has a third SIM card and so on.

您可以使用这个shell命令从第一张 SIM 卡:

You can use this shell command to send from the first SIM card:

service call isms 5 s16 "PhoneNumber" i32 0 i32 0 s16 "BodyText"

从第二张 SIM 卡

service call isms2 5 s16 "PhoneNumber" i32 0 i32 0 s16 "BodyText"

需要android.permission.SEND_SMS