Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differentiate MMS and SMS via MMS/SMS listeners in Android

Tags:

android

sms

mms

Is there any ways to differentiate MMS and SMS messages by using a MMS/SMS listener before they hit the inbox?

like image 616
Zerhinne Avatar asked Jul 19 '11 01:07

Zerhinne


People also ask

What is the difference between SMS and MMS on Android?

A text message of up to 160 characters without an attached file is known as an SMS, while a text that includes a file—like a picture, video, emoji, or a website link—becomes an MMS.

What's the difference between MMS and SMS messaging?

SMS messages have a restriction of 160 characters per text message, whereas MMS messages allow for unlimited characters. Another difference, much more significant in essence, is that MMS—as opposed to SMS—allows you to embed media files on a text message (i.e. images, audio files, clips, and gifs).

What is MMS messaging on Android?

MMS stands for Multimedia Messaging Service. It was built using the same technology as SMS to allow SMS users to send multimedia content. It's most popularly used to send pictures, but can also be used to send audio, phone contacts, and video files.

What is the difference between SMS and MMS when it pertains to mobile marketing?

SMS (Short Message Service) is essentially a 160-character text message that may include links. Whereas MMS (Multimedia Messaging Service) allows you to send a message with rich media content, including animated gifs and short video or audio files – and it has an increased limit of 1,000 characters.


1 Answers

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>

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.

like image 96
Jens Avatar answered Oct 21 '22 04:10

Jens