I am a beginner in developing android applications.
I want to build an application that has a local database in it, as i know so far , i should use the SQLite databases. i am ok with that,
but i want to understand how should i manage data synchronization between the application and the server, in other words, my application has a
local database which represents a "cache" for the online database - so it has to be synchronized with changes on it.
What is the best practicies for managing this operation?
In which cases should the application request data from server , and in which cases it simply loads them from the local database ?
I am looking for taking advantage of the local database on the best way.
posted 8 months ago
If the synchronization only ever happens from the server DB to the local DB, and never the other way around, the app should just work with the local DB. Whenever there are updates on the server that the device needs to get (that may or may not be all updates) the server can send a GCM notification to the app, containing either the updated data if it is small, or to prompt the app to request the updated data via HTTP or some other appropriate way.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads