如何在设置默认 SIM 卡的双 SIM 卡中在 android 中发送短信? [英] How can send sms in android in dual SIM with set default sim?

查看:73
本文介绍了如何在设置默认 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

这篇关于如何在设置默认 SIM 卡的双 SIM 卡中在 android 中发送短信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆