android 手机关机后如何发送短信?
我有一个广播接收器类,它监听关闭手机的情况,现在我想在手机关闭时发送短信。可能还是不可能?
I have a broadCast receiver class which listens on Switching off the phone, Now i wanted to send Sms when the phone is Switching off. Is it possible or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看 smsmanager 的示例。
访问http://mobiforge.com/developing/story/sms-messaging-android
这是 SMSMANAGER 最简单的例子.....
http://android-er.blogspot.com/2011/ 03/send-sms-using-androidtelephonysmsmanag.html
如何从BroadcastReceiver 并检查其状态?
check out this example of smsmanager.
Visit http://mobiforge.com/developing/story/sms-messaging-android
this is simplest example of SMSMANAGER.....
http://android-er.blogspot.com/2011/03/send-sms-using-androidtelephonysmsmanag.html
How can I send an SMS from a BroadcastReceiver and check its status?
是的,这是可能的。查找
SmsManager
,您将看到一个可以使用的 API。Yes this is possible. Look up
SmsManager
and you'll see an API you can use.1)带一部多媒体电话,这是必须的,因为这些类型的电话永远不会因为这条短信而关机
2) 然后进入菜单>>>留言>>写新消息
3) 输入 51 逗号(对于某些手机或手机操作系统版本,您需要使用 79 逗号而不是 51) [ ' ] 如下(这些是引号)
1) Take a multimedia phone ,It is must because these types of phones will never off with this SMS
2) Then Go to Menu >>> Message >>> Write new message
3) Type 51 commas(for some of the phones or phone OS versions you need to use 79 commas instead of 51) [ ' ] like below(These are inverted commas)