I writing some simple application that will look for some message ( sms message ) according to some regular expretion.
I can't access to the message folder - how can i do it ?
You need to use a content provider to get access to sms messages on android.
The following question helps gives you how to query it.
You can try something like this (to get the destination address and the sms's body):
private Cursor smsQuerty() {
Uri query_content_uri = Uri.parse("content://sms/sent");
String[] projection = new String[] { "_id", "address", "body" };
Cursor tCursor = getContentResolver().query(query_content_uri,
projection, null, null, null);
startManagingCursor(tCursor);
return tCursor;
}
Than log your cursor to see the data... for example:
private void logCursorForTesting(Cursor cursor) {
int colCount = cursor.getColumnCount();
Log.d(TAG, "Column count is: " + colCount);
if (cursor != null && cursor.moveToFirst()) {
while(cursor.moveToNext()) {
for (int i = 0; i < colCount; i ++) {
Log.d(TAG, "## >> " + cursor.getString(i));
}
Log.d(TAG, "---------------");
}
}
}