Keeping the same SQLite database when upgrading and Android app from Lite to Pro version

前端 未结 3 754
说谎
说谎 2021-01-31 06:06

First of all I have done a search and can\'t find a specific answer to my question so here goes...

I am writing my first Android application and plan to have a Lite vers

3条回答
  •  孤独总比滥情好
    2021-01-31 06:49

    As @Chris told that you can use "unlock" approach, i will explain it how i do in such conditions.

    You can have a table like 'Features' should have have a column/flag IsAvailable. If you want to restrict certain features you can set its IsAvailable flag to FALSE.

    If you have changes in DB structure, then you should upgrade the DB using:

    @Override
    public void onUpgrade()
    {
      if (condition == true)
        // alter table
    }
    

提交回复
热议问题