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.
Luke

--~--~---------~--~----~------------~-------~--~----~



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.

Genesio
--~--~---------~--~----~------------~-------~--~----~



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

Peace,
Scott

-- 

2. cliq dituntut

http://m.detik.com/read/2009/11/25/085635/1248272/399/blackberry-onyx-ditudi 
ng-langgar-paten



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

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

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