Twitter
Products / Projects
Non-Tech
  • The MIDI Manual: A Practical Guide to MIDI in the Project Studio
    The MIDI Manual: A Practical Guide to MIDI in the Project Studio
    by David Miles Huber
  • Principles of Digital Audio
    Principles of Digital Audio
    by Ken Pohlmann
  • Design Patterns: Elements of Reusable Object-Oriented Software
    Design Patterns: Elements of Reusable Object-Oriented Software
    by Erich Gamma, Richard Helm, Ralph Johnson, John M. Vlissides
  • The Art of Computer Programming Boxed Set (Volumes 1-3)
    The Art of Computer Programming Boxed Set (Volumes 1-3)
    by Donald E. Knuth
  • Cocoa(R) Programming for Mac(R) OS X
    Cocoa(R) Programming for Mac(R) OS X
    by Aaron Hillegass
  • Core Animation for Mac OS X and the iPhone: Creating Compelling Dynamic User Interfaces
    Core Animation for Mac OS X and the iPhone: Creating Compelling Dynamic User Interfaces
    by Bill Dudney
« Apple Accessibility Verifier | Main | Eyes-Free: An Android Accessiblity Project »
Wednesday
10Jun2009

Working With SMS (Text Messaging) on Android

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

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>