Sync Android contacts with server - syncing algorithm


Staff member
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:
<a href="" rel="nofollow"></a>

and a very good blog for understanding the pieces in the puzzle:
<a href="" rel="nofollow"></a>

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?