and the text file are not saved in /Documents (but only in /Download).
Note: In /Documents is only saved again when the number of previously created text files is exceeded (i.e. the app remembers how many files have been saved, even after they have been deleted).
I would like to understand this behavior, specifically how it is possible to save in /Download or /DocumentswithoutWRITE permission (and without using shared storage).
But of course you are right that this is (no longer) necessary if scoped (shared) storage is implemented correctly (in AI2).
Apparently, it seems that ewan already commited a fix that solves the crashing issue from method ‘openForWriting’ : appinventor-sources/FileUtil.java at hotfix/legacy-files2 · ewpatton/appinventor-sources · GitHub
But still one change is missing if they want to support most available paths like ‘Documents’,
instead of returning ‘null’ in method getContentUriForPath, this code should be added :
Here is a text APK that copies a text file or image from the assets to the shared storage (and reads the text from the text file or shows the image). This works for the text file (as it should be without READ / WRITE permissions). The image is copied (of course without WRITE permission, which is no longer available on Android 11), but the image is ONLY displayed if READ permission has been granted beforehand. Note: This should (in my opinion) be possible without READ permission.