Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the meanings of the values in the Android "content//sms/" content provider?

I queried "content//sms/" and I don't know what some fields mean. They are -

  1. Thread ID
  2. Protocol
  3. Status
  4. Reply_Path_Present
  5. Service_Center

I checked them in LogCat and found the values to be these:

  • Thread ID : 1 to 6 etc..
  • Protocol : null / 0
  • Status : -1
  • Reply_Path_Present : null / 0
  • Service_Center : null

Please tell me what the meanings of those values are.

like image 515
soclose Avatar asked May 20 '10 05:05

soclose


2 Answers

You can use Cursor.getColumnNames() to retrieve the column names of any content provider, e.g.

ContentResolver contentResolver = getContentResolver();
Cursor cursor = contentResolver.query(
    Uri.parse("content://sms/inbox"), null, null, null, null);

String[] columnNames = cursor.getColumnNames();

For content://sms/inbox this yields _id, thread_id, address, person, date, protocol, read, status, type, reply_path_present, subject, body, service_center, locked on my phone.

You can also have a look at the SmsProvider but it is not part of the public API.

like image 54
Josef Pfleger Avatar answered Sep 27 '22 22:09

Josef Pfleger


The folling is the way to determine all the columns that a particular Cursor has .

StringBuffer info = new StringBuffer();
for( int i = 0; i < Cursor.getColumnCount(); i++) {
    info.append("Column: " + Cursor.getColumnName(i) + "\n");
}

Print this out to know what are all the columns in the table .

like image 30
rockstar Avatar answered Sep 28 '22 00:09

rockstar