0

I have a SQL database and I would like to be able to copy to/sync with an SQLite in my android app so that people are able to query data without needing an internet connection. I wasnt sure how i would go about updating the SQLite database if fields or tables are altered in the SQL database.

What would be the best way about going about this, I have only ever used the databases separately and this is my first time doing this.

user3074140
  • 733
  • 3
  • 13
  • 30

1 Answers1

0

I recommend putting in a version table and use sql scripts to update the schemas. You'd need one script for the SQL server and one for SQLite. Then you can find all the scripts beyond the first on the android device ... and then run each script in turn.

I've done this before when I was looking after a few hundred remote desktop clients.

The main trick is making the SQL scripts work for the first run and if need be for a subsequent run.

Keith John Hutchison
  • 4,955
  • 11
  • 46
  • 64