I am creating an app to backup contacts to a webserver. I am still new to android development so I can't think of the logic to do this. I know that the contact id is not constant and it can change. So how can I keep track of changed data to existing and new contacts?
1 回答
You need to first grab the contacts in Android look at the example code in the AOSP project for the people app, that will show you the way that Google is doing it officially, which doesn't necessarily make it the best method, but it's a lot easier to re-tool their code than write it all from scratch.
Here's how to get started with the Android build environment: http://source.android.com/source/initializing.html
Here's another question, similar to yours that might help with the contact data: How to read contacts on Android 2.0
On your end, you need to setup a SQL server of some kind... and one of the fields just needs to be "Last Updated", either add a date to that field, or a revision number that you're tracking elsewhere and decide to update based on the query out of that field.