I am trying to make an Android To-Do client for a web service with offline caching and synchronization.
The web service returns JSON data about To-Do tasks on the server when you send a message to it. To add To-Do to the server, you need to send the JSON POST to the server with the details of the task, after which it will return the UUID task to you.
I want to implement some type of synchronization so that the tasks that I add when I am offline are sent to the server, and the data from the server is synchronized with the application (two-way synchronization) when the Internet is available.
I have currently written a basic To-Do content application that does not talk to the server. My question is, what would be the best way to implement such functionality?
Verification Planning
I believe that I need to get JSON from the server, insert it into the local SQLite database, perform comparisons and find the immutable elements and push them to the server. I think I can do this by adding asynchronous requests to my ContentProvider (not sure if this is the best way).
Que:
Should I write my own implementation of the same or can the SyncAdapter do all this magic? Are there any other design options that I should consider?
android android-syncadapter
karthik
source share