Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/46994097
Here, we briefly introduce the method of intercepting SMS by Broadcastreceiver.
1. Create SMS Broadcast receiver Smsrecevier
This class is a subclass of Broadcastreceiver, the specific interception operation implemented in this class, I am here just a simple introduction to the method, the acquisition of the text message to print out. The specific business logic will have to be achieved by all themselves.
The specific code is as follows:
2. Registration Authorization information
The specific implementation is as follows:
<?xml version= "1.0" encoding= "Utf-8"? ><manifest xmlns:android= "http://schemas.android.com/apk/res/ Android "package=" Com.lyz.sms "android:versioncode=" 1 "android:versionname=" 1.0 "> <uses-sdk Android oid:minsdkversion= "8" android:targetsdkversion= "/> <uses-permission android:name=" Android.permission.REC Eive_sms "/> <application android:allowbackup=" true "android:icon=" @drawable/ic_launcher "and Roid:label= "@string/app_name" android:theme= "@style/apptheme" > <activity android:name= "com . lyz.sms.MainActivity "android:label=" @string/app_name "> <intent-filter> &L T;action android:name= "Android.intent.action.MAIN"/> <category android:name= "android.intent.category . LAUNCHER "/> </intent-filter> </activity> <!--configure broadcast intercept SMS-- <receiver android:name= "Com.lyz.recEiver. Smsrecevier "> <intent-filter android:priority=" "> <action android:name=" Android. Provider. Telephony.sms_received "/> </intent-filter> </receiver> </application></manife St>
Is it as simple as "Android-intercept outbound calls"?
Warm tip: You can go to http://download.csdn.net/detail/l1028386804/8921125 intercept to get the complete code example
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android--Intercept SMS