host database with do-nothing app so lite and pro can access

拥有回忆 提交于 2019-12-04 09:42:34

It sounds like you decided to go with the in-app purchase of the pro app, however this may have also been a viable solution.

From your post you have a lite app that contains the database. When the user purchases the pro app, you have the pro app accessing the lite database for read/write. If these assumptions are true, why not do the following:

  1. When the pro app starts, have it create a database, so the pro app now has its own database.

  2. After that database is created, check to see if the lite app database exists, I assume you are already doing this because you are opening the lite app db in your pro app.

  3. If the lite app db exists, write the data from the lite app db into the pro app db. Now in your pro db you will have all lite db data. While using the pro app, the app should make calls to its own database going forward, and not the lite db. Now that the data from the lite app is transferred to the pro, the user can uninstall the lite app without worry that the data will be lost.

  4. If the lite db does not exists, then nothing happens and the pro app loads with its own database, blank data(or whatever you may need preloaded).

why dont you have the database in your server and whenever the app installed ( regardless the lite or the pro version) just pull the database from your server ( and overwrite the exist one if its exist ) , this is good also for your database security, becuase i can simply browse the apk file with zip softwar and get your database. the other benefit is that the apk file will be smaller in its size, more important it will it will solve your problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!