开发者

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

开发者 https://www.devze.com 2022-12-30 18:50 出处:网络
I queried \"content//sms/\" and I don\'t know what some fields mean. They are - Thread ID Protocol Status

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 开发者_如何学Python: 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.


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.


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 .

0

精彩评论

暂无评论...
验证码 换一张
取 消