How to distinguish MMS and SMS in android?

How to distinguish MMS and SMS through MMS/SMS listeners in Android? Because I received the number of SMS messages, as in MMS messages?

I am calculating Total MMS using the 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(); 
+4
source share
1 answer

You should check the ct_t column. If it is MMS, it should be equal to application/vnd.vap_multipart.related .

+2
source

All Articles