我的家园

我的家园

Android Contacts(一)—— 读取联系人

Posted on 2012-04-15 16:37 zljpp 阅读(260) 评论(0)  编辑  收藏

Introduction To Android Contacts

Learn to work with the Android contacts database. Basic knowledge of accessing SQLite in Android along with using Cursors is expected. See the Android SQLite and Cursor Article for more information. Google changed the contacts database moving from 1.x to 2.0 versions of Android. This tutorial will be broken into 3 sections. First covering accessing contacts in Android 2.0. The second page will deal with accessing the contacts in Android 1.6 and before. Third we'll glue it all together with a class that abstracts specific classes for each version and a set of classes to manage the data from the contact records.


Contacts 读取代码:

AndroidManifest.xml 权限

 记得在AndroidManifest.xml中加入android.permission.READ_CONTACTS这个permission

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


运行结果:



代码示例


参考推荐:

Working With Android Contacts

Android Contacts的使用 



只有注册用户登录后才能发表评论。


网站导航: