问题描述
我要检测短信传入和传出自动从我的应用程序,只要在这个应用程序是开放与否的背景。如何code?
I'd like to detect sms incoming and outgoing automatically from my application at background whenever this app is opening or not. how to code?
推荐答案
这是在发送和接收短信一个很好的教程:http://mobiforge.com/developing/story/sms-messaging-android 。
This is a good tutorial on both sending and receiving sms messages: http://mobiforge.com/developing/story/sms-messaging-android .
对于收到的邮件,你的确可以配置broadcastlistener进行检测。 *
For the incoming messages you can indeed configure a broadcastlistener for detection. *
检测传出的消息也有可能(只是改变了这个职位,因为我dind't知道这一点)。来自:http://www.mail-archive.com/android-developers@googlegroups.com/msg26420.html
Detecting outgoing messages is also possible (just altered this post since I dind't know this). from: http://www.mail-archive.com/android-developers@googlegroups.com/msg26420.html
ContentResolver contentResolver = context.getContentResolver();
contentResolver.registerContentObserver(Uri.parse("content://
sms"),true, myObserver);
这篇关于检测短信传入和传出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!