开发者

View and add contact in created application

I am creating an Android application which requires to view contacts from phone's contact a开发者_运维问答nd add contacts or sync it into my application. Is it possible to do this? How?

Thanks..


Yes, absolutely possible use content resolver and cursor

e.g. Reading contacts names

    Cursor cursor = getContentResolver().
    query( Contacts.CONTENT_URI, 
      new String[]{Contacts.DISPLAY_NAME}, null, null,null);

    if(cursor!=null){
      while(cursor.moveToNext()){

         String name = cursor.getString(cursor.getColumnIndex(Contacts.DISPLAY_NAME))
       }

Use following link for more information

http://developer.android.com/guide/topics/providers/content-providers.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜