Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strategy for updating Android app (with database)

Tags:

android

sqlite

Please forgive me if this question has been answered - I searched and couldn't find it.

I have an Android app that I want to upgrade, and it uses a SQLite Database. I want to update some of the application logic in the app, but there will be no updates to the database schema or contents. I basically need to keep the database exactly as-is for the user.

Do I need to do anything in onUpgrade to ensure that the database is kept, or can I leave the DB stuff alone for this update?

like image 847
John McCollum Avatar asked Feb 19 '12 09:02

John McCollum


1 Answers

The onUpgrade() method is used incases of version change. Which means the database stored in the phone needs to be altered or dropped or deleted and a new database to be created. As your application does not have any of these requirements you can leave the DB stuff for this update.

like image 158
user936414 Avatar answered Sep 17 '22 13:09

user936414