Hi I have a problem with the tinydb after unistall my app.
When I unistall and reinstall my app the data of my tinidb presist, I was searching in the foroum and I found the topic on app inventor foroum.
Evan from mit said this:
“Note that on newer versions of Android, Google automatically backs up all app data, so even if you uninstall and reinstall an app with TinyDB, it’s possible that Android will restore the database from the app backup”
So thats my problem and I am asking for a solution for this.
I can manually delete the data and the cache of my app manually from android settings but this is not a property solution because all my users have to do that and is not good.
Note: In app inventor foroum I didnt see a solution and thats why I am asking here.
Currently I am using tinydb in a project and didn’t get such problems, when I cleared data or uninstall app the tiny db data also get wiped.
I don’t know how are you facing the problem.
you might want to check on screen1.initialize, if there are data left in tinyDB. So just create a block to count app openings and if this is 1 (the first init), clear all tags and data
Ok this is not working. Because the tag is not set to 0 if app is deinstalled.
Hey I am using kodular and the blocks dont work in this case because the problem is after unistall the app and reinstall; the data presist. When I use normally the app i can clean all the data with block but this not the problem.
Probably this will not work.
As author has mentioned that all data is getting restored so that value will also get restored.
There are only two options left now:
create a file in app’s private storage folder (not in app’s specific dir) and check if file exists on first run
check if device’s imei number exists in online database