File is not saved, permissions are not recognized

That’s right. So far, only saving in the app folder is possible. But as you said, I would like to save the data in the download folder. Previously this was not possible due to the errors mentioned above. How can I save the data in the download folder. Unfortunately nothing has worked for me so far.

previously you used the file component
it does not look like you tried the suggestion from my last post

also you should learn how to use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun

I implemented your recommendation and installed and used the extension. The same problems arise here as well.

as far as I understand this thread, your goal is

So why do you continue storing the file in ASD then?

What you are saying does not make much sense, does it?

If Do it does not work for you, how are you able to provide a Do it result then?

Taifun

Sorry, maybe it’s all mixed up by now. My goal is to save a file as described in the download folder. Unfortunately, every attempt has failed so far. The only thing that works is that a file can be saved in the ASD. Everything else hasn’t worked so far. I’ve tried different paths. There is always an authorization error. In the extension I tried every building block. Each building block is stored in the ASD and not outside. But I want to go there. Do it somehow didn’t work at the beginning, hence the sentence. I have now adjusted my text because it then worked as can be seen in the picture.

Ok, start again from here

And in case there already is a file myTest.txt in your Download folder, delete it before starting to test

In case it still does not work for you, then provide a screenshot of your relevant blocks and NOT a screenshot of saving a file in ASD

Taifun

Here are the blocks:

Bild 1

Nothing is saved and although all permissions have been granted, the application starts with error 908 (as mentioned above). A do it result was not given for either the extension’s block (used in the screenshot) or the normal file block (without extension).

The blocks look fine and should work without asking for permission
I probably can do some tests tomorrow…

Taifun

I actually think so too. But don’t get it to work. Thank you, I would be very happy.

here is a working example

Some remarks about how to get it running

after looking at the example project MFile - a modified version of Sunny's `EFile` extension - Shared folders - storage permissions - Android 11+ you can find out, that the extension requires a full path to the file
and to read a file, you have to add file// to get again a full path

filetest.aia (16.5 KB)



tested in companion app on Samsung A51 running Android 13

Taifun

2 Likes

It works and I’m happy. Thank you for your patience and your great help. I can finally add this working feature to my app. THANKS!

It would be a good idea to test this also on older devices < Android 10. … most probably you have to ask for write permission there…

Taifun

I think I’ll test it and possibly ask the user for permissions. Now I’m trying to read files from Explorer again to read the data again. The user may want to rename or move the file and then want to access it. I’ll get to work. Any tips for me in advance?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.