Android Question Prevent delete file at reinstall

ThePuiu

Active Member
Licensed User
Longtime User
Hi,
I want to make a quiz application. The replies are saved in a SQLite database. How can I ensure that the reinstallation of the application will not delete the database with existing responses? What is the best approach?
Thank you
 

DonManfred

Expert
Licensed User
Longtime User
You app can not use a DB inside your assets (files folder). So you ARE copying the db to another place.
If you deinstall the app the file is still at this place
If you run your new app you should check if the file is already there and if yes you use it.
 
Upvote 0

ThePuiu

Active Member
Licensed User
Longtime User
This means to copy the database after each response to File.DirAssets? I want the user not to have to do anything....
 
Upvote 0
Top