Mobile Database Application

Soldato
Joined
5 Mar 2003
Posts
10,768
Location
Nottingham
Looking for a bit of advice!

Got a current windows mobile 6.5 application which has a fairly complex SQLite database (20+ tables). We're migrating the application Android and iOS, and as they both support SQLite I was hoping it would be a fairly easy exercise!

The main question I have is deployment. At the moment the SQLite database is a pre-defined database, and the application only allows the user to update when the data is in the right state (i.e. the user has uploaded all the information they have put in).

All the examples I've seen for Android have the database being built up in code, and I'm also unsure of if / how you can stop updates happening if the data isn't in the right state (data loss is unacceptable), as the Windows Mobile application controls the update, where as for the newer generations it's all 'Store' driven.

So in summary:
1) How is it best to manage database structures - can you deploy a db designed in a GUI?
2) Can you have any control over the update process? If not how to do manage data to ensure nothing is lost; create a copy of the database and hydrate - really want to avoid creating the database structure in code?
 
Soldato
Joined
3 Jun 2005
Posts
3,119
Location
The South
Am i right in thinking you're wanting to know what happens to the SQLite database, and in turn data, in the situation that the Android/iOS app gets updated via the Play/App store?

IIRC with Android (been a while since i've played with Android programming), if you create the database locally then it's a case of checking if a database exists, if so use it, otherwise create it.
If you need to make changes to the database, ie - schema/data etc, then you use the onUpdate() method for DB update code which is triggered by incrementing the database version.

You can bundle the DB with the apps assets which you could then copy out to local storage but tbh it's easier to just create the schema via SQL queries within the app.

Edit - Have a look on stackoverflow.com as i suspect there are already answers to similar questions.
 
Back
Top Bottom