There is no conceptual difference between a one-way and a two-way sync.  My
understanding is that most people start the sync by sending local changes to
the server and then get incoming changes.

The DIRTY column on RawContact will tell you what changed locally.  Make
sure you reset the flag after the changes have been successfully sent to the
server.

You can use the Exchange sync as a source of inspiration.  Unfortunately,
it's crazy complex (out of necessity). Still you may dig up some copy/paste
opportunities there, e.g. the "commit" method:

http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=blob;f=src/com/android/exchange/adapter/ContactsSyncAdapter.java

<http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=blob;f=src/com/android/exchange/adapter/ContactsSyncAdapter.java>
Cheers,
Dmitri

On Thu, Jun 17, 2010 at 10:06 AM, BeerBelly <bostjan.bru...@gmail.com>wrote:

> Hey,
>
> I'm developing an application that needs a two way sync of its own
> custom contacts. I saw the sample code on Android developer website
> (talking about AccountManager here and the sample sync adapter code),
> but that only syncs from the cloud to the device. Is there a way to do
> the two way sync? Can someone point me in the right direction with
> this?
>
> Could really use the help here.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to