In general, is it a bad idea to require beta testers to do a clean install of the app with every update? The reason I ask is because I prefer not writing the code to upgrade the internal sqlite databases and save time on other tasks. Is there a way to require a clean install with a new version number (version code hasn't incremented yet)?
Asked
Active
Viewed 75 times
0
-
If you don't cater for database upgrades then do you expect your users to perform a clean install? – CurlyPaul Apr 30 '14 at 15:08
-
1As for beta testing not writing the code to upgrade will indeed save you time. I think you can skip it until your last tests, where you need to be sure it works correctly. – shkschneider Apr 30 '14 at 15:08
-
1IMHO, it is not a beta test if your code is not feature complete, which would include handling database upgrades. Also, your testers either will not use the app in a realistic fashion (because they do not want to waste time entering data that they will lose) or will be pissed at you (because they *did* waste that time). – CommonsWare Apr 30 '14 at 15:17
-
@CommonsWare that's intended that they reenter data because changes have been made to how the data is saved. – mpellegr Apr 30 '14 at 15:26
-
also, most of the data is stored on an external server and is reloaded into the database without any issue. – mpellegr Apr 30 '14 at 15:27
1 Answers
1
It's really not a big deal to handle upgrades. I create a string that does describes the change:
private static final String ALTER_TABLE1 =
"ALTER TABLE player ADD COLUMN enablesound INTEGER DEFAULT 1";
and when your database version changes for your users, you execute this helper function:
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.w(TAG, "Upgrading database from version " + oldVersion + " to "
+ newVersion + ". No data will be destroyed");
if (oldVersion == 1) {
db.execSQL(ALTER_TABLE1);
}
}

Martin
- 4,711
- 4
- 29
- 37