发送短信的广播接收器

时间:2011-09-27 14:41:44

标签: android sms broadcastreceiver

Android中是否有广播接收器收听短信发送事件?

在我的应用程序中,我想计算每个预定义时间间隔发送的SMS数量。如果无法收听发送的短信,任何人都可以共享代码来计算短信和指定时间,例如最近30分钟。

2 个答案:

答案 0 :(得分:1)

检查此链接....我认为它不是完整的解决方案,但您有一些想法如何实现......

http://www.anddev.org/other-coding-problems-f5/sms-mms-contentobserver-and-service-t12938.html

你可以实现内容:// sms /发送观察者se ..所以如果有任何变化,那么你可以得到事件,所以你可以计数或获取行动发送短信或mms .......

答案 1 :(得分:-2)

您可以使用谷歌的SmsManager api编辑自己的短信,并通过PendingIntent通知:

SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage (String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent)

您可以使用以下参数通知您的投放: PendingIntent sentIntent

但现在不推荐使用SmsManager :(

相关问题