检测短信传入和传出 [英] Detecting SMS incoming and outgoing

查看:105
本文介绍了检测短信传入和传出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

推荐答案

这是在发送和接收短信一个很好的教程:<一href="http://mobiforge.com/developing/story/sms-messaging-android">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知道这一点)。来自:<一href="http://www.mail-archive.com/android-developers@googlegroups.com/msg26420.html">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);

这篇关于检测短信传入和传出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆