如何使用短信内容提供商?哪里有文档? [英] How to use SMS content provider? Where are the docs?

查看:95
本文介绍了如何使用短信内容提供商?哪里有文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够读取系统的短信内容提供商。基本上我想做一个短信应用程序,但它会如果我能看到过去的线程才有用处等。

I'd like to be able to read the system's SMS content provider. Basically I wanted to make an SMS messaging app, but it would only be useful if I could see past threads etc.

好像有一个内容提供商,但我无法找到的文档是 - 任何人都知道这是

It seems like there's a content provider for this, but I can't find documentation for it - anyone know where that is?

感谢

--------编辑-----------

-------- edit -----------

好,我找到了一种方法来获取短信收件箱提供商,而我只是把所有的列名在该提供商,看起来是这样的:

Ok I found a way to get the sms inbox provider, and I just dumped all the column names in that provider, looks like this:

Uri uriSms = Uri.parse("content://sms/inbox");
Cursor c = context.getContentResolver().query(uriSms, null,null,null,null); 

// column names for above provider:
0: _id
1: thread_id
2: address
3: person
4: date
5: protocol
6: read   
7: status
8: type
9: reply_path_present
10: subject
11: body
12: service_center
13: locked

我只是拼凑了一起随机线程我发现周围净,我真的想知道,这是所有记录(如果有的话)?

I'm just piecing this together from random threads I find around the net, I'm really wondering where this is all documented (if at all)?

再次感谢

推荐答案

不幸的是内容提供商的短信和彩信(<一href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob%5Fplain;f=core/java/android/provider/Telephony.java;h=d8c5a53771a7af9f73273dd788db1fc3ed4f674e;hb=HEAD"><$c$c>android.providers.Telephony)不是的<一部分href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob%5Fplain;f=api/current.xml;h=55d910508cca358fbe653fc2f50e66e40bc521fd;hb=6eccc390737a873d2334d628e1d06cc1857fcaee">public API 在这一刻,直到它,你可以使用自己定义的常量<一href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob%5Fplain;f=core/java/android/provider/Telephony.java;h=d8c5a53771a7af9f73273dd788db1fc3ed4f674e;hb=HEAD">this作为模板。

Unfortunately the content provider for Sms and Mms (android.providers.Telephony) is not part of the public API at this moment. Until it is, you can define your own constants using this as a template.

这篇关于如何使用短信内容提供商?哪里有文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆