ThePuiu Active Member Licensed User Longtime User May 19, 2017 #1 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
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 May 19, 2017 #2 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
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.
ThePuiu Active Member Licensed User Longtime User May 19, 2017 #3 This means to copy the database after each response to File.DirAssets? I want the user not to have to do anything.... Upvote 0
This means to copy the database after each response to File.DirAssets? I want the user not to have to do anything....
Erel B4X founder Staff member Licensed User Longtime User May 19, 2017 #4 Your program will copy the database. The user will not do anything. You can use DBUtils.CopyDBFromAssets: https://www.b4x.com/android/forum/threads/dbutils-android-databases-are-now-simple.8475/#content Upvote 0
Your program will copy the database. The user will not do anything. You can use DBUtils.CopyDBFromAssets: https://www.b4x.com/android/forum/threads/dbutils-android-databases-are-now-simple.8475/#content
DonManfred Expert Licensed User Longtime User May 19, 2017 #5 ThePuiu said: This means to copy the database after each response to File.DirAssets? Click to expand... Assets are readonly. You can not copy something back to this place. Upvote 0
ThePuiu said: This means to copy the database after each response to File.DirAssets? Click to expand... Assets are readonly. You can not copy something back to this place.