• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android SQLite

 
Redan Hassoun
Greenhorn
Posts: 26
Android AngularJS Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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.
 
Tim Moores
Bartender
Posts: 3128
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic