The explanation of the Android messaging database in this post How to Read MMS Data in Android? have been very helpful. Unfortunately I do not have enough reputation to ask for a clarification there. I need to get the time an MMS message was sent. Is this available through the database? If not, is it saved anywhere else? Getting the sent time from the the phone on the sending end would also work.
Edit: I see now that the DATE_SENT attribute is available but I don't know how to access it. Is there a provider for this like there is for the address?
Update: This is what my code looks like:
int id = 0;
ContentResolver contentResolver = getContentResolver();
final String[] projection = new String[]{"*"};
Uri uri = Uri.parse("content://mms-sms/conversations/");
Cursor query = contentResolver.query(uri, projection, null, null, null);
if (query.moveToFirst()) {
do {
String string = query.getString(query.getColumnIndex("ct_t"));
if ("application/vnd.wap.multipart.related".equals(string)) {
//MMS
System.out.println("b:mms found");
System.out.println("b:thing in table is " + query.getString(query.getColumnIndex("_id")));
id = Integer.parseInt(query.getString(query.getColumnIndex("_id")));
System.out.println("b:" + getAddressNumber(id));
} else {
//SMS
System.out.println("b:sms found");
}
} while (query.moveToNext());
}
It works for column index of _id and date but not date_sent.