• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Android SQLite

 
Ranch Hand
Posts: 41
Python Angular Framework Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 7597
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic