Ted

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

We all know android has content provider, and we can access these data with content resolver,

 

1) add permission,

        <uses-permission android:name="android.permission.READ_CONTACTS" />

2) getContentResolver

        ContentResolver cr = getContentResolver();
        Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,

3) Enumerate and Query



For other data, for example, sms,etc,  it‘s similar, the only different is the uri, have fun!

Reference: 
 1) http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/
 2)  http://developer.android.com/guide/topics/providers/content-providers.html
 
 
posted on 2012-05-21 20:52  wufawei  阅读(234)  评论(0编辑  收藏  举报