How Can I Access To All The Message ( Sms ) Folder In The Phone ?
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 ?
Solution 1:
You can try something like this (to get the destination address and the sms's body):
privateCursorsmsQuerty() {
Uri query_content_uri = Uri.parse("content://sms/sent");
String[] projection = newString[] { "_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:
privatevoidlogCursorForTesting(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, "---------------");
}
}
}
Post a Comment for "How Can I Access To All The Message ( Sms ) Folder In The Phone ?"