Search code examples
androidsqlitegoogle-playtarget-sdk

How do I ensure users keep their SQLite data when I update on the google play store?


I would like to raise my target and compile version to 28 from 26. This is because a user emailed me and said that the app doesn't work properly on his phone which runs andoird 9.

Once I upped the target and compile versions, I tested out the app with various devices and it seems like everything is running just fine with different devices and emulators.

However I'm concerned that with the new SDK target and compile versions, that users might lose their data when they update. My DatabaseHelper class extends SQLiteOpenHelper.

Do I have to do anything to make sure their database tables are preserved when I update with the higher target and compile version?

NOTE: My database schema is staying the exact same with the update.


Solution

  • Changing the target SDK version will not lost the data of existing users if they update the app over existing(with lower sdk).

    What you can do to verify this is instal the previous build(with lower sdk) from play store and upload your new build in alpha release(with the updated target sdk) and add yourself as a tester. When alpha release gets live it will give you an option to update the app on previous app(with low target sdk).

    when you hit the update button you will get your results.

    This way you can make verify this.