I am using code similar to another SO post. But my MIME type for every MMS is "application/smil". How do I determine if the MMS contains a picture, audio, text, etc?
Here is the code I am using at the moment:
String selectionPart = "mid =" + id;
Uri ur = Uri.parse("content://mms/part");
Cursor cur = getContentResolver().query(ur, null, selectionPart, null, null);
if (cur.moveToFirst()) {
do {
String[] values = new String[cur.getColumnCount()];
for (int i = 0; i < cur.getColumnCount(); i++) {
values[i] = cur.getString(i);
}
String partId = cur.getString(cur.getColumnIndex("_id"));
String type = cur.getString(cur.getColumnIndex("ct"));
This is what is contained in values String[] for an audio MMS:
[56, 98, -1, application/smil, smil.xml, null, null, null, <0000>, smil.xml, null, null, null, <smil>
<smil>
<head>
<layout>
<root-layout height="480px" width="320px"/>
<region fit="meet" height="160px" id="Text" left="0" top="320" width="320px"/>
</layout>
</head>
<body>
<par dur="11000ms">
<audio dur="11000ms" src="cid:171"/>
<text region="Text" src="cid:172"/>
</par>
</body>
</smil>
]