Saving and reading files with android 11

And a final note, which I have made countless times in other places:
The File component incorrectly requests storage permissions even for the Shared folders.

This is of course a bug on Android 11+ !

2 Likes

To avoid storage permissions on Android 11+, you can do so using Sunny's EFile (@vknow360) and @Taifun's TaifunFile extensions.

2 Likes

first let me apologize for mixing up your name Anke, will not happen again.
thank you all for the quick input you provided.

now i am using taifunFile extension from 2019 and would have thought that the newer version would handle the android11 situation transparent to the user but maybe not. Again i also cannot figure out how to upgrade to the latest TaifunFile extension, would it help?

Anke while typing all this it just dawned to me that actually said COMPILE the app. i missed this because it never was an issue in android8.
good news is that the compiled app WORKS :slight_smile:

so does that now mean during development phase i cannot test file operations as was possible in android 8? that would be a bummer.

Patel i will also look into your suggestion - thanks.

good news is with your help i can continue with my work -
thanks a lot
erhard

A post was split to a new topic: Taifun Screenshot not working (for me)

hm this is super frustrating please help. based on your suggestions i added the following to my first screen
image

and i get the error 908 ....write external storage...
i did give permission in the settings screen of the app but error still shows. as much as i like appinventor but this is really very difficult. Taifun in another thread also mentions the issue with multiple screens, which i have. i never had any issues in android 8.
i am not sure what else to try.

thanks in advance

erhard

This is a common error; please search the community before posting.

sorry but i did try several hours before i posting, but thanks for the hint.
anyway i found that hint to set the first screen filescope to LEGACY - i have not seen this mentioned anywhere before.
and i found the file in INTERNAL memory.
so even i give permission to EXTERNAL it is now in internal memory. simply beyond my mental capacity now

1 Like

Why don't you try my test app?
Everything is set up there so that it works on all Android versions.

DefaultFileScope = Legacy (→ Designer)
saveToShared_2.aia :

I tested your app saveToShared_2.aia, when I clic on save button the app stops with filescope shared, runs good with filescope legacy. (Android11)

As I've shown (above):

1 Like

I tested it with 11

Companion or APK?

It works on Android 11 and 12 (also with Shared).

Companion, I did not build it

What does "the app stops" mean?
Take a screenshot ...

I can not, the app closes itself with companion.
I tried apk with shared, it runs well.
With companion 2-62u no problem with shared

Which companion version did you test with before?

grafik

I tested with 2.61

Anke i did try both of your examples and they worked - thanks.
when i tried mine with your changes it did not because i missed that LEGACY setting in the default screen. i do have multiple screens. this hint i found in another of your responses.
now i took the first block out as you suggested and it still works - great.
i think this all now makes me be able to finish my project for the most part.

if you don't mind there are still 2 open issues related to this:

  1. i still have not found a guide on how to update an existing project with a new extension ( i asked that one before) and
  2. i use the the taifinscreenshot block and that still comes up with "open failed...EPERM operation not permitted" this is running the apk and it is a different screen in the same app

image

thanks again for you patience and help to solve my issues

Erhard

For your two open issues:

  1. Updating an existing extension
  • Download the latest version of the extension
  • Open your project in App Inventor
  • In the designer palette on the left, scroll down to Extensions
  • Click on import and select your latest version from your computer
  • If all goes well, you should get a notice that your extension has been upgraded
  • If it fails, you may need to contact the extension developer about this, or worse case the new extension is not compatible with the previous version. In this latter case, you will have to uninstall the version you have, then install the new version. This will mean a lot of work in the blocks editor! Make a copy of your project and save to your PC before starting this.
  1. Taifun Screenshot
    You have another topic for this here
    Taifun Screenshot not working (for me)

Please ask questions about this there

1 Like