昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期五, 二月 20, 2015

Understand android contact database


Getting the contact photo is such a big pain.

To understand what uri to use to get the info. It's better that you can view the database directly. 

This is how:

Create an android emulator with SD card and save few contacts. 

Use this command to dump the sql lite dataase.

adb pull /data/data/com.android.providers.contacts/databases/contacts2.db contacts2.db

Use the sqlite browser to view the sqlite database. 


The last part of content provider URI is ID.

For example, 

content://com.android.contacts/data/136

point to table data where id = 136.





--
Feng

没有评论:

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.