开发者

Updating Android app properly?

Help! I updated my android application on the market. This update included a change in the databaseHelper file where I put in more data and tables. Normally, when debugging, I would have to uninstall and reinstall the app because it doesn't see the new values in the database. Now, it's doing the same thing on the market.

开发者_高级运维Why is this happening? How can I fix this? Is it possible to 'rollback' the changes to the app?


You can't roll it back - there is no history in the market. You can publish your previous version again (which, of course, will cause database mayhem again).

As for upgrading databases - You should be using SQLiteOpenHelper to manage your database. That way, you can have a version number, which will be used to call onUpgrade() when necessary at which point you can use ALTER TABLE to add new columns (or create new tables altogether). The notepad example demonstrates all this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜