Android“content//sms/”中的值的含义是什么?内容提供商?

发布于 2024-09-02 02:16:26 字数 344 浏览 3 评论 0原文

我查询“content//sms/”,但我不知道某些字段的含义。它们是 -

  1. 线程 ID
  2. 协议
  3. 状态
  4. Reply_Path_Present
  5. Service_Center

我在 LogCat 中检查了它们,发现这些值是:

  • 线程 ID:1 到 6 等。
  • 协议:null / 0
  • 状态:-1
  • Reply_Path_Present:null / 0
  • Service_Center:null

请告知我这些值的含义是什么。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

他是夢罘是命 2024-09-09 02:16:26

您可以使用 Cursor.getColumnNames() 检索任何内容提供者的列名称,例如

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

String[] columnNames = cursor.getColumnNames();

对于 content://sms/inbox 这会产生 _id、thread_id、地址、人员、日期、协议、读取、状态、类型、回复路径当前、主题、正文、服务中心,锁定在我的手机上。

您还可以查看 SmsProvider 但它不是公共 API 的一部分。

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.

如梦亦如幻 2024-09-09 02:16:26

以下是确定特定 Cursor 具有的所有列的方法。

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

打印出来以了解表中的所有列。

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 .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文