问题
I want to update the database of installed application. First of all, I couldn't the database file path; there is no file called mypackage in /data/data/ . How can I find the database file path?
Secondly, I want to delete the old file and replace it my new database. How can I manage this?
回答1:
say you make a program with the packagename of com.example.program, your path will be
/data/data.com.example.program/databasefile
bur for updating it, put your code in onUpdate and change the version number
http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#onUpgrade%28android.database.sqlite.SQLiteDatabase,%20int,%20int%29
来源:https://stackoverflow.com/questions/8583994/android-database-update-on-device