
It is to be placed in the assets folder of the project for the internal method or copied into the "Execute SQL' of SQLite Manager to create the database for the external method.

Here is a sample update_database.sql file. INSERT INTO "android_metadata" VALUES ('en_US') (NOTE: Notice the comment about the table required by Android.) -Android requires a table named 'android_metadata' with a 'locale' columnĬREATE TABLE "android_metadata" ("locale" TEXT DEFAULT 'en_US') Here is a sample create_database.sql file. The example below demonstrates how to use either method. The data in the database will remain unchanged except when its container is removed, for example dropping a table. Upgrades would then be accomplished by processing an upgrade sql file. Upgrades are triggered by changing the database version number in the res/values/strings.xml file. This is not as quick but the delay would probably be unnoticeable to the users if the database has only a few tables. The other option is to create a database internally from a sql file. You can create a database originally by using the SQLite Manager FireFox plugin to execute your creation sql statements.

Upgrades would then be accomplished by creating a new database externally, replacing the old database in the assets folder with the new database, saving the old database in internal storage under another name, copying the new database from the assets folder into internal storage, transferring all of the data from the old database (that was renamed earlier) into the new database and finally deleting the old database.

This is much quicker if the database has a lot of tables and other components. One is to create a database externally, then place it in the assets folder of the project and then copy the entire database from there.

There are two options for creating and updating databases.
