soclose
soclose

Reputation: 2783

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:

Please tell me what the meanings of those values are.

Upvotes: 5

Views: 6697

Answers (2)

rockstar
rockstar

Reputation: 3538

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 .

Upvotes: 1

Josef Pfleger
Josef Pfleger

Reputation: 74517

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.

Upvotes: 6

Related Questions