Pragnesh Soni
Pragnesh Soni

Reputation: 307

How to Differentiate MMS and SMS in android?

How to Differentiate MMS and SMS via MMS/SMS listeners in Android? Because I got SMS counts as in MMS counts?

I am calculating Total MMS as using following code.

Uri mmsInboxUri = Uri.parse("content://mms/inbox");
Uri mmsSentUri = Uri.parse("content://mms/sent");

Cursor mmsInboxCursor = getContentResolver().
                         query(mmsInboxUri ,new String[] {"_id"},  null, null);
Cursor mmsSentCursor = getContentResolver().
                         query(mmsSentUri ,new String[] {"_id"}, null, null);
int mmsCount = mmsInboxCursor.getCount() + mmsSentCursor.getCount();

Upvotes: 4

Views: 320

Answers (1)

Manitoba
Manitoba

Reputation: 8702

You should check the column ct_t. If it's a MMS it should be equal to application/vnd.vap_multipart.related.

Upvotes: 2

Related Questions