Android: what to do with application/smil MIME type
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:
This is what is contained in values String[] for an audio MMS:
| |||||
|
The problem is that you're assuming that your cursor only has 1 entry. It actually does not.
For MMS messages, you will find that there are 3 (or more) entries corresponding to the same mid . They are described below:
Typically, I would filter the _data column for non-empty value to get to the attachment row right away. (The _data column will contain the uri path for where the attachment is saved on the phone. That row will be null for all other rows that do not correspond to the MMS attachment. So you must search for the row that matches your mid and where _data column value is not null ) When you find that row, you can just read the ct column of that row to find the MIME type of the row. That will tell you what type of file is being transferred in the MMS message be it image/xyz or audio/abc or video/qwe etc... |