live database update android

Spirit.vn

New Member
This is not a typical question to a certain coding problem its a more like a design/implementation problem and i would like to hear some suggestions from someone that has done this before or someone that can point me to a topic that has a wider discussion on the topic.Here we go:I have made an application that uses a SQLite database, that is currently stored in the assets folder.Since the database will be updated frequently (once a week), i would need some suggestion how to make an optimal system for updating the database for end users.
  • When the user downloads the app from the market, they receive the most up to date DB.
I was thinking like this:Have a database on a server also (PHP, mySQL), and when the user starts the app, the app connects to the server and checks what current version is on the phone and what is on the server and if it is different do an update.In this case i should put the database on SD card on the phone so i could update it regularly, since it cant be changed in assets.Since my goal is to minimize data transfer, would it be good to just update certain tables of the database that have changed?In this case should i keep for each table a version number, and then if it differs to drop the table and update it with new data on the phone?The app wont always have internet access so this will be done when ever the user enables internet.I know and have done the basics before, connecting to server in async task and services, and then the .php file does some queries and sends data to phone.The questions is how to manage the update most effectively and safely? Updates will include, inserting and deleting rows as well as changing existing ones.Is the system i described efficient enough and i should just pack the data in json and send it to the app from the server using some of the existing protocols described online?Thank you for any help/suggestions.
 
Top