I have 2 lines code:
private static final Uri SMS_INBOX = Uri.parse("content://sms/inbox");
Cursor c = getContentResolver().query(SMS_INBOX, null, null, null, null);
Where to find column list of this cursor?
Yes :)
private static final Uri SMS_INBOX = Uri.parse("content://sms/inbox");
Cursor c = getContentResolver().query(SMS_INBOX, null, null, null, null);
android.util.Log.i("COLUMNS", Arrays.toString(c.getColumnNames()));
And the answer is:
05-27 09:27:39: INFO/COLUMNS: [_id, thread_id, address, person, date, protocol,
read, status, type, reply_path_present, subject, body, service_center, locked]
This, BTW, is the exact table structure of table SMS in MMSSMS database - connect DDMS to the emulator and use FileExplorer to get the whole database from:
data/data/com.android.provider.telephony/databases/mmssms.db
Then use SQLite Database Browser (free) to take a look at the tables. Be sure to simulate one SMS from DDMS so that there is something in the tables, though :)
try using below code
String[] list = cursor.getColumnNames();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With