I have been trying to implement SyncAdapter to sync data between client(android device) and server using sqlite.The same data will be shared between different devices.
On Update: As soon as a particular record is updated on one client device it will be pushed to the server. At that moment the updated record should also be synced from the server to other connected devices.
Now, when we send sync request from other connected devices, what is the best way to know which record get updated on the server?
Here is what I would do to achieve this:
You can easily pull the value from an endpoint /last_sync/ to see if the sync_time has changed.
By comparing the two timestamps, you can then decide as to whether you want to sync down new data or keep the old until the new ones are synced.
I hope this helps. Good luck!