Android update SQLite DB schema?

You will probably want to override

onUpdate(SQLiteDatabase db,int old Version,int newVerison)

The following tutorial can walk you through the process: http://www.codeproject.com/KB/android/AndroidSQLite.aspx


What is the best practice for updating the DB schema?

Use SQLiteOpenHelper. The only time you will be updating your schema is when you update the application. Whether you have the SQL commands in a file that you read in or just in your Java code is up to you.

I am guessing then I will have a flag to indicate that the update has been done.

That is part of what SQLiteOpenHelper gives you.

I havent found a way to delete a file in the asset folder from the app, which would be the best thing to do after the DB was updated.

That is not possible, sorry.

Tags:

Sqlite

Android