Android: SMS and contacts data access
I'm trying to do a backup & restore application and I want to backup all SMS and all contacts informations. I read a lot about content providers but I first tried to copy these contacts2.db
and smsmms.db
files (the lazy and easiest way I figured out ) with no success because of permission issue (these databases are private).
Now it seems like conten开发者_Python百科t providers remain my only issue. I thought about accessing each data field in both SMS and contacts, store it in files(XML format) with a specific structure, being easy to read and restore.
Is that a good way? Are there any other easy ways instead of content providers for my backup & restore purpose?
You need to access Content Providers
http://developer.android.com/guide/topics/providers/content-providers.html
getting contacts is explained on that page but it doesn't mention sms, for sms use the Uri of content://sms (i think)
精彩评论