How to get the SMS massage?

by lukewar » Tue, 13 Jan 2009 01:14:03 GMT

Sponsored Links
 I have a problem, how to get the sms massage in adroid. I have found a
solution how to get the incoming sms massage but still i can not get
to the already stored massages. Please help.


How to get the SMS massage?

by PRATAP SOLAPUR » Tue, 13 Jan 2009 13:14:07 GMT

 Look into android.telephony.gsm ann smsmanager classes...............


Sponsored Links

How to get the SMS massage?

by Genesio » Tue, 13 Jan 2009 19:00:58 GMT

 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.


Other Threads

1. Calling startActivity() from outside of an Activity...

I have a TabActivity subclass that attempts to start a new activity
via a menu item selection in onOptionsItemSelected.  I am receiving
the following exception which eludes me at the moment!  I'm not sure
why it thinks I am *not* in an activity!  Any clues?

android.util.AndroidRuntimeException: Calling startActivity() from
outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK
flag. Is this really what you want? menu



2. cliq dituntut 

Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to

To request to subscribe to this group:


3. How to extract .properties files from third-party jar to apk file?

4. How to extract the .properties files in a third party jar file to apk file

5. How to show a 'Progress View' during a ListView is loading

6. Button is not clicking. OnClick Listener not being triggered.

7. onDraw() being called multiple unintended times