4

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();
Freak
  • 6,786
  • 5
  • 36
  • 54
Pragnesh Soni
  • 197
  • 1
  • 12

1 Answers1

2

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

Manitoba
  • 8,522
  • 11
  • 60
  • 122