Reputation: 5872
I want to sync my android device's contacts with a server (1-way syncing: update server according to the device's contacts DB).
I've seen the SampleSyncAdapter example: http://developer.android.com/resources/samples/SampleSyncAdapter/index.html
and a very good blog for understanding the pieces in the puzzle: http://ericmiles.wordpress.com/2010/09/22/connecting-the-dots-with-android-syncadapter/
I understand that the sync logic itself is supposed to be in overriding onPerformSync() in a class extending AbstractThreadedSyncAdapter.
I was not, however, able to find an example for the syncing algorithm. For instance, how do I sync just the diffs from the previous sync? am I supposed to keep a cache for the latest synced contacts and diff it with the current contacts DB?
Upvotes: 2
Views: 4993
Reputation: 11453
Ideally, you offload much of that work to the server.
If you're talking about a REST api type of server, you have two options.
If that isn't supported by their REST API,
Upvotes: 0