Working With SMS (Text Messaging) on Android
Wednesday, June 10, 2009 at 4:25PM As part of the Alvin Project, I have been implementing my own version of an SMS client. For the most part, this has been surprisingly easy to do, and has served as a great learning experience for future Android projects. I wanted to post some info on what I've learned about the SMS classes available. The most challenging aspect has been the lack of documentation on SMS for Android, and the work arounds that are required.
You can access a lot of information about your texts with the URI:
Uri mInboxURI = Uri.parse("content://sms/inbox");
You can then get a cursor to the data itself. This statement will retrieve all information about the SMS's and sort them in descending order according to date:
Cursor C = getContentResolver().query(mInboxURI, null, null, null,"date DESC");
Notice how the literal "date" had to be used. This is because there are no public documents or classes that identify the table columns available. This thread describes the available column headings that you can call. They are:
- thread_id
- address
- person
- date
- protocol
- read
- status
- type
- reply_path_present
- subject
- body
- service_center
http://stackoverflow.com/questions/419184/how-to-delete-sms-from-inbox-in-android-programmatically
Android,
SMS,
Text Messaging,
mobile devices in
Android






Reader Comments