Hello Dmitri, I am learning about sync adapters and contact syncing.
But i am unable to understand this scenario: Suppose, I update/delete a contact from the native app and the relevant flag(Delete or Dirty) gets set, now how can i be sure that whenever my sync adapter runs, the flags were not reset by the google sync adapter(or any other adapter)? I have been banging my head since a few days now, but still cannot figure it out. I would be extremely grateful for your help. Regards, Sarthak Mittal On Thursday, 17 June 2010 23:17:03 UTC+5:30, Dmitri Plotnikov wrote: > > 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 <[email protected] > <javascript:>> 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 [email protected] >> <javascript:> >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/def582ce-70e2-4ad3-aa21-050f4040552a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

