通过区分在Android中MMS / SMS听众彩信和短信 [英] Differentiate MMS and SMS via MMS/SMS listeners in Android
问题描述
时有什么方法来区分彩信和短信使用MMS / SMS听者他们以前的打收件箱?
Is there any ways to differentiate MMS and SMS messages by using a MMS/SMS listener before they hit the inbox?
推荐答案
彩信的第一个指标是WAP推送的MIME类型应用程序/ vnd.wap.mms消息,这样你就可以注册接收器,用于android.provider.Telephony.WAP_PUSH_RECEIVED:
The first indicator of an MMS message is a WAP-push with the MIME-type "application/vnd.wap.mms-message", so you could register a receiver for "android.provider.Telephony.WAP_PUSH_RECEIVED":
<receiver android:name=".SomeReceiverName"
android:permission="android.permission.BROADCAST_WAP_PUSH">
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
要发现与否的你将不得不破解打开PDU接收的彩信:S和提取 X-MMS消息类型
,其中应 M-通知-IND
(按<一个href="http://www.google.com/url?sa=t&rct=j&q=wap-209-mmsencapsulation-20020105-a.pdf&source=web&cd=1&ved=0CBoQFjAA&url=http://www.openmobilealliance.org/tech/affiliates/wap/wap-209-mmsencapsulation-20020105-a.pdf&ei=htWvTsvqGpDDswadxfVz&usg=AFQjCNFrfkpNVXMxZ_ErlgUQBmqNcbROcA&cad=rja"相对=nofollow称号=WAP 209> WAP 209 )。你也可以挑选出在X-MMS-交易-ID,其中一个认为应存放在 Telephony.Mms.TRANSACTION_ID
列中的消息提供者,如果你要链接他们稍后。
To discover whether or not its a received MMS you're going to have to crack open the PDU:s and extract the X-Mms-Message-Type
, which should be m-notification-ind
(as per WAP 209). You can also pick out the X-Mms-Transaction-ID, which one thinks should be stored in the Telephony.Mms.TRANSACTION_ID
column in the message provider if you want to link them up later.
这篇关于通过区分在Android中MMS / SMS听众彩信和短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!