检测短信传入和传出短信

由网友(怪我过分顽皮总想逃离你)分享简介:我要检测短信传入和传出自动从我的应用程序,只要在这个应用程序是开放与否的背景。如何code?I'd like to detect sms incoming and outgoing automatically from my application at background whenever this app is...

我要检测短信传入和传出自动从我的应用程序,只要在这个应用程序是开放与否的背景。如何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);
阅读全文

相关推荐

最新文章