The question and background
Regarding AI2 apps in mobile phones using Android 11. Can AI2 scoped storage 'File' blocks read external files, and write app generated text files between the app and the shared media folders:'Documents' and 'Download'. These links suggest they can:
http://ai2.appinventor.mit.edu/reference/components/storage.html
https://developer.android.com/training/data-storage/shared/documents-files
https://source.android.com/devices/storage/scoped
Also, the files and media permissions available for AI2 apps in the Android 11 settings appear to confirm this. However, tests using the attached App were unable to read or write text files between the App and the Download or Documents media folders.
T2File1.aia (32.0 KB)
Method
In the test App the read and write permissions were both ticked in the Designer page.
Read and Write permissions could also be manually requested. The scope could be switched between 'App' and 'Shared'. The default was set to 'Shared' in the Designer page, and it was also manually set to shared prior to each test. The file existence in the folder was checked prior to each test. The test file path was either <Document/FileName.txt> or <Download/FileName.txt> with no leading '/'. The files used to test the write function were all generated by the test app. Only one copy was made of each file. The units tested were a Nokia 2.1 mobile phone with Android 10 and a Nokia 5.4 with Android 11.
Results
The Nokia 2.1 had an SD card formatted as Internal Shared and the File storage scope set to shared. On first using the App the read and write permissions buttons had to be used despite the read and write boxes being already ticked in the Designer (reference Anke's posts). However, the test App could write and read the test files to and from the Internal Shared Storage 'Document' and 'Download' shared directories.
The Nokia 5.4 mobile phone had Android 11 and no SD card, the storage file scope was set to shared and the App 'Files and Media permission' in the phone settings was switched on. If the App tried to read a text file from the Internal Storage 'Document' or 'Download' shared directories, Error 2102 was flagged saying: 'The File cannot be read'. If the App tried to write a text file to the Internal Storage Document or Download shared directories, Error 908 was flagged saying 'The Write external storage is denied'. Manually requesting a read external storage permission had no effect. Manually requesting a write external storage permission produced another 908 error message.
Interpretation ?
Have I missed anything? Do I need to install an SD card formatted for external storage to share files when using Android 11?
Is the Apps inability with Android 11 to read or write shared text files in the Download and Document media folders a bug or is it intended? If it is intended what is the proper usage for the shared storage scope?
Should I report this as a Bug?