简体   繁体   中英

How to retain the older database after the android app is upgraded to new version?

我只是希望用户即使在将应用程序升级到应用程序的新版本之后仍保留其较旧的数据库。是否可以,如果可以的话。请帮助我是菜鸟吗?

It is version of db in constructor as mentioned below which tells whether app is going to update database or not. So it is not dependent on the the version of app . So if you haven't update the db version then not a problem for users who upgrade the app.

public class TimeTrackerDatabase extends SQLiteOpenHelper {

    public TimeTrackerDatabase(Context context){
        super(context, "dbname.db", null, DB_Version);
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM