1
votes

I am making an app that fetch all contacts and save it my db which is working perfectly.

Now whenever user do CRUD operation in native i want that to be observed by my app so that i can update in my db too. So after lot of research i found there is no way to know which particular contact has been updated or deleted.

So i compared the CONTACT_LAST_UPDATED_TIMESTAMP of contact with my sync time.

Now the issue am facing is with Google sync that runs every 20 minutes and update all contacts CONTACT_LAST_UPDATED_TIMESTAMP. It makes me to update all those contacts

Is there any other possible way to achieve syncing (to get particular contact that has been updated). Tried Sync adapter, tells only change in URI not particular contact.

Any help or lead will be appreciated. Thanks

1
I had to maintain a list of my own in my application's database to keep track of any change in my native contacts - Reaz Murshed
i cant compare every time to get the changes. As app need to be updated every second - Rohit
this is not what i asked for. Even the version is being updated - Rohit
Why don't you try BroadCast Receiver to get broadcast message about contact Update , add or delete? Or ContentObserver ? - Nouman Ghaffar

1 Answers

0
votes

One way would be to keep a local copy of contacts db only needed information like id and version.

Here 'version' is an interesting column which is increased everytime there is a change in the contact. so you can use this to find out exactly which one is changed.