Reputation: 17008
I have an Android application that installs a database (~2000 rows across all tables) to the device when it is first opened. The user can make minor changes to it (one column only) and it is only updated on a new version release.
Due to the nature of the database/application, it is not possible to put the data online (yet).
I am assuming I will install the database (onCreate) with a LOT of inserts, then update it every now and then, and then insert more rows (onUpdate?) with each new release. What would be the best practices for this procedure?
Working with deployed databases is new to me, so any help would be appreciated!
Thanks!
Upvotes: 0
Views: 245
Reputation: 29995
Well, I can suggest the migration way. Keep data version in the database. Make each application distribution have files like 1.0-to-1.3.upd, 1.3-to-1.4.upd holding all the update data to make a transition to a new version of the data.
Each OnUpdate() should check data version in the database and check a list of *.upd files it have to determine if data update is required. And then just applies necessary updates one by one, increasing data version in db each time.
This is like VBulletin and XenForo forums updates work.
Upvotes: 1