Broadcast Receiver for Sent SMS

自作多情 提交于 2019-11-29 23:26:28

问题


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.


回答1:


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.......




回答2:


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 :(



来源:https://stackoverflow.com/questions/7571026/broadcast-receiver-for-sent-sms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!