Possible Duplicate:
How can I read SMS messages from the inbox programmatically in Android?
I want get all the inbox sms from an android device. How do I do that?
Possible Duplicate:
How can I read SMS messages from the inbox programmatically in Android?
I want get all the inbox sms from an android device. How do I do that?
You can get inbox messages from following method.
public List<String> getSMS(){
List<String> sms = new ArrayList<String>();
Uri uriSMSURI = Uri.parse("content://sms/inbox");
Cursor cur = getContentResolver().query(uriSMSURI, null, null, null, null);
while (cur.moveToNext()) {
String address = cur.getString(cur.getColumnIndex("address"));
String body = cur.getString(cur.getColumnIndexOrThrow("body"));
sms.add("Number: " + address + " .Message: " + body);
}
return sms;
}