S11
April 11, 2024, 4:26pm
1
Hi, I added tinydb to my app by default the tinydb holds {"NetworkPermission":true}
I deleted it from the app, saved the progress restarted AI2, added tinydb as a new component.
I have not added or saved anything to the db but it holds {"NetworkPermission":true}, if I delete the entry its fine.. but when I reload the app it reappears.
Ive just opened a different project, added tinydb and set a text box to Call tinydb.GetEntries
it displays {"NetworkPermission":true}
Any ideas ?
Ramon
April 11, 2024, 4:31pm
2
If the namespace is the same...you will see the same data stored...remove the tag or use a different namespace.
This topic can also be helpful to you:
Just a short question:
Will entries in TinyDB be deleted after uninstall of the App?
I am asking because on firstrun of an app I am setting a tag “firstrun” with the tag “DONE”, in order that some files will be downloaded on firstrun of an app.
I just noticed, that after uninstall and installtion again, the tag is still “DONE”
S11
April 11, 2024, 4:35pm
3
I was tested using companion on 2 different phones same result, so i built an apk to test it on phone only same result
Ramon
April 11, 2024, 4:43pm
4
From the topic I have shared above:
Could it be, that the Companion App uses the same Database than an App and that, when closing the companion App, the Database will not be emptied?
Yes, this is how it works. The TinyDB is app-wide. The app is the companion (not your project), and therefore you can query for entries in the companion's TinyDB that are from a different project. One way to get around this is to use the Namespace property on TinyDB, which stores the key-value pairs into a different TinyDB than the main one.
S11
April 11, 2024, 4:47pm
5
Ramon, that does seem to have solved the issue, I cant say that I understand the namespace thing but it has worked, thanks
Ramon
April 11, 2024, 4:51pm
6
Take a look at this:
I am using TinyDB on my application and there's also a property called 'namespace'
However, I am not able to understand what the property means as in the documentation it just says:
[image]
Please help me with what are namespace. Also, don't provide me with fruitstand example, just tell me briefly what it really means.
Thanks,
Krish
You will find very interesting information and it will surely be clearer to you, including this graphic explanation of the namespaces:
In this example TinyDB1, TinyDB2 and TinyDB3 are the same database, because it has the same namespace (TinyDB1)
TinyDB4 is a different database than the previous ones, because it has a different namespace (TinyDB4) .
Taifun
April 11, 2024, 5:08pm
7
from here TinyDB after uninstall of an APP - #6 by ewpatton
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.
Taifun
S11
April 12, 2024, 6:39pm
8
Ramon yes that makes it much clearer !!
S11
April 12, 2024, 6:42pm
9
Taifun, that sounds like it could make things even more confusing !!