我希望能够读取系统的短信内容提供商。基本上我想做一个短信应用程序,但它会如果我能看到过去的线程才有用处等。
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)?
再次感谢
不幸的是内容提供商的短信和彩信(android.providers.Telephony)不是的public API 在这一刻,直到它,你可以使用自己定义的常量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.