Broadcast Receiver for Sent SMS

2019-02-11 03:27发布

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.

2条回答
Melony?
2楼-- · 2019-02-11 03:53

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

查看更多
Viruses.
3楼-- · 2019-02-11 04:00

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

查看更多
登录 后发表回答