接收彩信
<receiver android:name=".smsreceiver" android:permission="android.permission.BROADCAST_WAP_PUSH"> <intent-filter android:priority="10000"> <action android:name= "android.provider.Telephony.WAP_PUSH_RECEIVED" /> <data android:mimeType="application/vnd.wap.mms-message" /> </intent-filter> </receiver>
接收wap push
<receiver android:name=".smsreceiver"> <intent-filter> <action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" /> <data android:mimeType="application/vnd.wap.sic" /> </intent-filter> </receiver>
接收短信
<receiver android:name=".smsreceiver"> <intent-filter> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver>
然后在程序里用一个
public class smsreceiver extends BroadcastReceiver
来进行相应的接收即可
别忘记 加上权限
<uses-permission android:name="android.permission.RECEIVE_MMS" /> <uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
本文链接http://blog.csdn.net/Zengyangtech/archive/2010/09/15/5885508.aspx
转载请注明