联系人以哪种格式存储在android中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2174943/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:49:53  来源:igfitidea点击:

In which format the contacts are stored in android?

androidandroid-contacts

提问by Rajapandian

I want to know in which format the contact details are stored in android mobile or emulator.If any body knows the answer please help me.

我想知道联系人详细信息以哪种格式存储在android手机或模拟器中。如果有人知道答案,请帮助我。

回答by Oliver

The contacts are stored in a SQLite3 database file so the file format is ".db"

联系人存储在 SQLite3 数据库文件中,因此文件格式为“.db”

The development tool Android Debug Bridge(ADB) can be used to extract the file from an EMULATOR

开发工具Android Debug Bridge(ADB) 可用于从EMULATOR 中提取文件

ADB can also extract the file from a phone but it must be rooted first AND the ADB drivers must be installed on your machine as well

ADB 也可以从手机中提取文件,但必须先植根,并且 ADB 驱动程序也必须安装在您的机器上

(Rooting is NOTfor beginners though)

(虽然生根适合初学者)

The contacts.db file is stored in the protected system memory, the file path is:

contacts.db 文件存储在受保护的系统内存中,文件路径为:

data/data/com.android.providers.contacts/databases/contacts.db

数据/数据/com.android.providers.contacts/databases/contacts.db

回答by Roman Nurik

You can access contact information programmatically using ContactsContractand AccountManager(in Android 2.0); there's an example on how to do so in the SDK, called Contact Manager.

您可以使用ContactsContractAccountManager(在 Android 2.0 中)以编程方式访问联系信息;在 SDK 中有一个关于如何执行此操作的示例,称为Contact Manager