-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/10/2010 11:03, Dan wrote:
On Mon, 11 Oct 2010, simon ransome wrote:
I did try saving a test contact to the phone itself and seeing if I could grep for it, to no avail.
A quick google around suggests that the contacts are in a file
/data/data/com.android.providers.contacts/databases/contacts2.db
No idea about the format, though.
Interestingly, that folder does not seem to exist on my Desire - at least it's not visible via the mounted file system, and when doing an "adb shell" I don't seem to have permissions to traverse anything other than the root directory (the device isn't rooted - it's running O2's Froyo/2.2[1]). There is a commercial Android sshd server [which gives an optional root user] available via the marketplace, but it's $1.50 and they only take credit cards, so I can't be arsed to download it to try to see if I can escalate privileges to better explore the file system. However, your post did get me poking around adb[2] a bit - it turns out that, for instance, I can't get root permission on any production-build device (see above about not being rooted), and although I appear to be able to cd into the directory you posted above, I still can't see any of the contents in it, so it's kinda moot really: MacOSX: adb shell shell$ cd /data/data/com.android.providers.contacts/databases shell$ ls opendir failed, Permission denied The format though - as was suggested elsewhere in this thread yesterday, and despite my not being able to open it to know for certain - does seem to be SqLite, at least as corroborated by several references I've come across. Meanwhile, I did forget to mention in my original reply that the Android contacts manager can both export and import contacts to/from the SD card, so that seems to offer some scope for some rudimentary roll-your-own syncing (however, doing syncing well is a lot harder than it sounds!). Simon [1] thankfully, O2 do little more than skin the phone's start-up splash, unlike the crapware that Orange and Voda have insisting on stuffing on their Android phones in the past [2] adb - Android Debug Bridge - is a really useful command-line utility that comes with the Android SDK - it allows direct installation of .apk apps to the device, detail logging of phone events and JS and an interactive shell, amongst loads of other stuff - -- ====================================================================== Simon Ransome http://nosher.net Photo RSS Feed: http://nosher.net/images/images.rss -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.14 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAky0O5IACgkQ8tdcY+OcZZytqwCfTKxZdS666KVJ+XsEHvRSMYxn Wo4An1BSGwdLLlBjHnDQ2+SQxeykya8S =LdQv -----END PGP SIGNATURE-----