发送短信的广播接收器[英] Broadcast Receiver for Sent SMS

本文是小编为大家收集整理的关于发送短信的广播接收器的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

是在Android中有一个广播接收器来收听SMS发送的事件?

在我的应用程序中,我想计算每次预定义时间间隔的SMS数量.如果它不可能倾听发送的短信,任何人都可以共享代码来计算SMS和指定时间,例如持续30分钟.

推荐答案

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

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

您可以实现内容://sms/sect Observer se ..如果此内容有任何更改,那么您可以获得事件,以便您可以计算或获取动作发送短信或MMS .......

其他推荐答案

您可以使用Google的SMSManager API编辑自己的SMS,并由PendingTentent通知:

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

可以使用参数传递通知: pendingintent sentintent

但SMSManager现在已被推弃:(

本文地址:https://www.itbaoku.cn/post/102378.html

问题描述

Is there a Broadcast Receiver in android to listen to the SMS sent event?

In my application I want to count the number of SMS sent every predefined time interval. If its not possible to listen to sent sms, can anyone share code to count SMS and for specified time for example last 30 minutes.

推荐答案

Check this link....i think its not complete solution but you have some idea how to implement...

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

you can implement content://sms/sent observer se.. so if any changes in this then you can get event so u can count or get action sent sms or mms.......

其他推荐答案

You can edit your own sms with SmsManager api from google and be notified by a PendingIntent:

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

You can be notified of the delivery with the parameter: PendingIntent sentIntent

But SmsManager is now deprecated :(