Detecting MMS messages on Android

徘徊边缘 提交于 2019-11-27 13:20:13

Detecting an incomming MMS message is easy, just put in broadcast receiver monitoring WAP_PUSH_RECIEVED events, as in...

<receiver android:name=".PushReceiver">
  <intent-filter>
    <action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
    <data android:mimeType="application/vnd.wap.mms-message" />
  </intent-filter>
</receiver>

Making sense out of what you get is a lot harder. I managed to decode everything I wanted from the WAP_PUSH_RECEIVED intent by cloning the PDU parsing code from the Mms app.

Retrieving the actual contents from the part files is what I am still working on, which is how I found this topic in the first place.

the incoming msg your ContentObserver detect is Notification type MMS, when phone receive this notification, it will download from mmsc the real MMS. So, when you detect new msg, you should filter Notification type.

final IntentFilter filterMMS = IntentFilter.create("android.provider.Telephony.WAP_PUSH_RECEIVED", "application/vnd.wap.mms-message");
filterMMS.setPriority(Integer.MAX_VALUE);
registerReceiver(smsreceiver, filterMMS);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!