问题
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.
回答1:
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.
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"
and from the second SIM card
service call isms2 5 s16 "PhoneNumber" i32 0 i32 0 s16 "BodyText"
Require android.permission.SEND_SMS
来源:https://stackoverflow.com/questions/24007885/how-can-send-sms-in-android-in-dual-sim-with-set-default-sim