The File component will ask for the READ and WRITE permissions which aren’t needed for the external directories. If you don’t want to ask for the READ and WRITE permissions, you can relook over my previous response referencing the extension I recommended!
I know that, but that’s not the subject of our considerations here, only the question of whether it is possible to save to the ASD with the File component. And it does.
So you were wrong in your claim:
It is well known that the READ/WRITE
permission problem can be avoided with the EFile
extension. But this was not the question.
I already provided an extension that can be used.
Back then I would’ve been correct, but I do remember at one point being unable to save files to certain paths.
I love you, my application can save files normally
I am really not a fan of the File
component for these reasons:
- The really disturbing thing is the constant alternation between relative and absolute path.
- Copying from the assets does not work
- Permissions are also requested for the ASD (but this applies to many components, but I’m sure this will be fixed when Kodular targets Android 11, Aug 2021).
Here are all blocks, where you can see that for the SaveFile
method a relative path is needed, but for the Copy
method you must set an absolute path.
I hope that this (and the other points) will be adjusted / fixed with the next Kodular update.
→ @Kodular
Great! Is there a way to test it?
Maybe on the Beta
server, but unfortunately the build server doesn’t seem to be working there at the moment.
I will push the changes to beta over the weekend
Beta server has been updated
Changelog:
- Fixed File Copy function doesn’t accept asset path
- Fixed File Copy function doesn’t accept relative file names
- Fixed File Exists function doesn’t work for assets
Sorry, but the Beta
server still does not work, neither with Companion nor can the APK be built.
What about the 3rd point:
I suspect this will stay that way for now and will be changed after Kodular targets Android 11. Am I right?
The beta server targets Android 11 currently. The permissions are asked for the component. We need to implement conditional permissions from App Inventor in order to control the unnecessary permissions. Also, currently, the runtime permissions are requested for the whole function, i.e, the function arguments such as file names are not checked before requesting permissions. This needs to be fixed.
I know, of course I didn’t mean the Beta server.
So to avoid permissions in the meantime, we can use the EFile
extension from @vknow360 .