Uh, there's a complete "sort-of-working-if-you-disregard-the-
embarrassingly-huge-glaring-holes-in-the-default-contacts-app-that-
Google-will-never-fix" example @ developer.android.com.

http://developer.android.com/resources/samples/SampleSyncAdapter/index.html

On 31 mar, 14:25, Udayan Warnekar <udayan.warne...@gmail.com> wrote:
> Hi,
>
> I am working on a contacts backup and sync.
>
> The target is to send all details of all contacts to a server (custom
> protocol defined) as a backup.
>
> During initial launch of application, all the contacts will be queued and
> sent to the server. And after that, a background service will be running all
> time which will listen to new contact addition/ contact update, and this
> new/updated contact will be sent to server by the background service.
>
> I am using 
> RawContactsEntity<http://developer.android.com/reference/android/provider/ContactsContr...>
> for
> fetching the records.
>
> I tried using ContentObserver on RawContacts/Data tables to get notification
> of contact addition or contact-change. But, AFAIK, the ContentObserver gives
> notification (onChange()) of changed data in table as a whole and not ID of
> individual record.
>
> Now my problem is, how to get the exact id's of changed/new records?
>
> I thought of creating a backup-table to compare with native contacts table
> and get the changed records. But as the number of contacts increase, the
> performance will decease drastically and this will hamper the battery life
> too.
>
> Can you suggest me, The best way for achieving this contacts backup
> operation from performance and memory usage point of view? Is there any
> other way for contacts sync operation?
>
> It would be very helpful if anyone can share examples which can help me in
> this.
>
> --
> Regards,
> *Udayan  Warnekar*

-- 
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