I couldn't get to the original post from April 2023, so I started a new one...Sorryyyy...
In Android 13, I want to copy the file dbKnihy.sqlite from the folder...Documents/... to ASD.
It works for me via Companion...it creates dbBooks.sqlite with the tblBooks table.
But when I compile the .apk, it creates only dbKnihy.sqlite with the android_metadata table in the ASD folder on my mobile, the tblKnihy table is not there.
ASD path in mobile is: file:///storage/emulated/0/Android/data/_data_appinventor.ai_ondrejruz.Knihy/files/dbKnihy.sqlite
It doesn't work even when there is a relative path in gPathASD....
Where am I doing wrong?
Ondrej
It only works in Companion. So, in Companion, it just copies the file from the private directory on my mobile.../Documents/Zalohy/dbKnihy.sqlite to ASD and displays the contents of the file nicely. As soon as I make an .apk out of it, it doesn't copy correctly... and it's bad...
Ondrej
You may need to delete the sqlite.db file in /Documents/Zalohy/ before your compile and try the app again. (Reason - not possible to work with files created by another app - e.g. companion app)
I save the dbKnihy.sqlite archive in the folder /Documents/Zalohy. So if I change the version of the .app, this new version will no longer "recognize" the file created by the previous version of the app?
If so, how is the file backup done?
Ondrej
No, in this case it is still the same app, only a new version
@TIMAI2 was talking about first testing using the companion app and storing the file and later trying to read that file after building the app, because theny ou are trying to read a file created by another app...
You forgot to answer this question
Also previously you used a wrong path... what about using the correct path?
Hello. The app for copying the dbKnihy.sqlite file from /Documents/Backups/ to ASD does not work for me. That's why I created a test app with only a few blocks. In the input folder, dbKnihy has a size of 49,152. In the output folder after copies, it has only 12,000. Next, the app crashes with a Syntax error. quote in unquoted cell. In the output file, only the android_metadata table is copied... I am attaching blocks...
Can someone help?
Ondrej
So the conclusion is probably that if I create e.g. in app1 the file dbKnihy.sqlite, so in another app, e.g. app2, I can no longer read that file and copy it to ASD in app2....
Is that so ?
Ondrej
Take us through the journey that your sqilte.db file goes through, step by step, from start to finish, then perhaps we can advise on the best course of action.