The simplest example is to open a Cursor in this way:
Cursor curSms = managedQuery(Uri.parse("content://sms"), null, null,
null, null);
(you can add /inbox in the Uri to get only incoming messages)
This Cursors has the following columns:
addressCol= mCurSms.getColumnIndex("address");
personCol= mCurSms.getColumnIndex("person");
Note: this is the Contact ID of the corresponding person, not the
actual Contact Name. You have to open a Cursor with People.CONTENT_URI
and get the value in "display_name" column.
dateCol = mCurSms.getColumnIndex("date");
protocolCol= mCurSms.getColumnIndex("protocol");
readCol = mCurSms.getColumnIndex("read");
statusCol = mCurSms.getColumnIndex("status");
typeCol = mCurSms.getColumnIndex("type");
subjectCol = mCurSms.getColumnIndex("subject");
bodyCol = mCurSms.getColumnIndex("body");
Some values are null, so make sure you check them.
Have fun.
Genesio
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---