Copy dbKnihy.sqlite from ...Documents/.... to ASD

Here are the basics, tested compiled.

Filescope in Screen1 designer set to Legacy

I used an image, but your sqlite.db file should work in the same way.

Thanks for the example.
It works for me in Companion, but not on mobile.
Ondrej

Show us your blocks and explain how you found out, that it did not work to copy the file to ASD
Taifun

I send blocks. How do I send the dbKnihy.sqlite file?

Ondrej
[mod edit: please do not post aia projects containing paid extensions]

Test just one procedure at a time, your call to four procedures at once may be causing a conflict / failure.

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?

Taifun

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

blocks(12)







You do not appear to have taken any of our advice above.....

Simplify your blocks, and just focus on the copying of the file from shared storage to the ASD.

Once you have that working, then you can start complicating things :wink:

Build in small steps, testing and checking at each step to ensure you have files in place and the correct file paths and permissions.

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.

you still can read it using SAF

Taifun

1 Like

...and copy file to ASD as well.

1 Like

Hello.
I'm trying to delete a file in /Documents.... It won't delete it...
Blocks are attached....
It is good?
Ondrej

You must use SAF to delete non-media files on Android 11 and above.

Yes, if and only if those non-media files are not created by the app itself (on Android 11+). The same applies to media files. If they are not crearted by the app you must use SAF to delete them on Android 11+.

1 Like

So I should add another final detail to my Android Storage overwiew:

Hello.
Couldn't you find an example?
Ondrej

An example of what?

Everything you need to know about your topic has already been said. If your sqlite file was not created by the same app (for whatever reason - reinstallation, previous testing with Companion etc) then you must use SAF to access that file (or request and grant MANAGE_EXTERNAL_STORAGE).