1。 附图为理解Contact的关键
查看数据库
sqlite> .table
_sync_state phone_lookup view_data_usage_stat
_sync_state_metadata photo_files view_entities
accounts properties view_groups
agg_exceptions raw_contacts view_raw_contacts
android_metadata search_index view_raw_entities
calls search_index_content view_stream_items
contacts search_index_docsize view_v1_contact_methods
data search_index_segdir view_v1_extensions
data_usage_stat search_index_segments view_v1_group_membership
default_directory search_index_stat view_v1_groups
deleted_contacts settings view_v1_organizations
directories status_updates view_v1_people
groups stream_item_photos view_v1_phones
mimetypes stream_items view_v1_photos
name_lookup v1_settings visible_contacts
nickname_lookup view_contacts voicemail_status
packages view_data
sqlite> select * from mimetypes;
1|vnd.android.cursor.item/email_v2
2|vnd.android.cursor.item/im
3|vnd.android.cursor.item/nickname
4|vnd.android.cursor.item/organization
5|vnd.android.cursor.item/phone_v2
6|vnd.android.cursor.item/sip_address
7|vnd.android.cursor.item/name
8|vnd.android.cursor.item/postal-address_v2
9|vnd.android.cursor.item/identity
10|vnd.android.cursor.item/photo
11|vnd.android.cursor.item/group_membership
sqlite> select * from raw_contacts;
_id|account_id|sourceid|raw_contact_is_read_only|version|dirty|deleted|contact_id|aggregation_mode|aggregation_needed|custom_ringtone|send_to_voicemail|times_contacted|last_time_contacted|starred|pinned|display_name|display_name_alt|display_name_source|phonetic_name|phonetic_name_style|sort_key|phonebook_label|phonebook_bucket|sort_key_alt|phonebook_label_alt|phonebook_bucket_alt|name_verified|sync1|sync2|sync3|sync4
1|1||0|2|1|0|1|0|0||0|0||0|2147483647|Sss|Sss|40||0|Sss|S|19|Sss|S|19|0||||
2|1||0|2|1|0|2|0|0||0|0||0|2147483647|Sss|Sss|40||0|Sss|S|19|Sss|S|19|0||||
3|1||0|3|1|0|3|0|0||0|0||0|2147483647|Rt|Rt|40||0|Rt|R|18|Rt|R|18|0||||
sqlite> select * from data;
_id|package_id|mimetype_id|raw_contact_id|is_read_only|is_primary|is_super_primary|data_version|data1|data2|data3|data4|data5|data6|data7|data8|data9|data10|data11|data12|data13|data14|data15|data_sync1|data_sync2|data_sync3|data_sync4
1||5|1|0|0|0|0|1 338-651-6830|2|||||||||||||||||
2||4|1|0|0|0|0|Eee||||||||||||||||||
3||7|1|0|0|0|0|Sss|Sss||||||||1|0||||||||
4||5|2|0|0|0|0|1 395-805-7571|2|||||||||||||||||
5||7|2|0|0|0|0|Sss|Sss||||||||1|0||||||||
6||5|3|0|0|0|0|1 234-587-963|2|||||||||||||||||
7||7|3|0|0|0|0|Rt|Rt||||||||1|0||||||||
8||8|3|0|0|0|0|Etti
|1||Etti
|||||||||||||||
9||8|3|0|0|0|0|Ui|2||Ui|||||||||||||||
sqlite> select * from contacts;
_id|name_raw_contact_id|photo_id|photo_file_id|custom_ringtone|send_to_voicemail|times_contacted|last_time_contacted|starred|pinned|has_phone_number|lookup|status_update_id|contact_last_updated_timestamp
1|1||||0|0|0|0|2147483647|1|0r1-4B4B4B||1444895246122
2|2||||0|0|0|0|2147483647|1|0r2-4B4B4B||1444895317735
3|3||||0|0|0|0|2147483647|1|0r3-494D||1446610189764