升级黑莓数据库(upgrade blackberry database)
在我的应用程序中,我有一个写入sdcard的数据库。 我们不得不对数据库进行很多重大更改,因此当用户升级应用程序时,有没有办法删除并重新安装数据库,但只能在升级时使用?
In my application, I have a database that gets written out to the sdcard. We have had to make a lot of big changes to the database, so when the user upgrades the application, is there a way to delete and reinstall the database, but only on upgrade?
最满意答案
执行此操作的最佳方法是在升级中使用一大块代码检查旧数据库,如果找到旧数据库,则执行升级。
这可以让你控制发生的事情,以及它是如何发生的。
The best way to do this is to have a chunk of code in the upgrade that checks for the old database and if it finds an old database, do the upgrade.
This lets you control what happens, and also how it happens.
更多推荐
发布评论