I don't know of these 'printscreen' pictures gives anything, but you say, that scope 'Legacy' (and scope *APP') works on all phones (only on my phone the scopes works as I describes, apparently)
Legacy: Files will be read from and written to the file system using the App Inventor rules prior to release nb187. That is, file names starting with a single / will be read from and written to the root of the external storage directory, e.g., /sdcard/. Legacy functionality will not work on Android 11 or later.
I think, the confusion are the 2 different file scopes we have
in the Screen properties the DefaultFileScope and
the file scope of the file component
as @Anke already pointed out "endless times" , btw. last time was here
unfortunately up to now without feedback from @ewpatton, still looking forward to it...
what we have to do currently (as far as I understand it) to get "it" running on all Android versions is
in the Screen properties set the DefautlFileScope to Legacy to get the correct permissions in the manifest and
set the File scope of the file component to what you need in your app, for example
a) if you like to store/read to/from shared storage, you set File Scope to Shared
b) if you like to store/read to/from ASD, you set file scope to App
Yes, except for the small difference that when FileScope = Shared is set, the / at the beginning is ignored, so the file is always stored in external storage and not in the Private dir of internal storage (as is the case with FileScope = Legacy is if there is no/ at the beginning of the path).
Otherwise (i.e. if there is no/ at the beginning of the path) these two scopes work identically.
To get the required permissions. These are indeed the correct permissions on Android < 11, but on Android 11 these are the incorrect permissions because
on Android 11+ there is no longer WRITE permission and
both permissions (READ / WRITE) are not needed at all (for the Shared folders).
Since AI2 decided to declare requestLegacyExternalStorage=true in the Manifest (which is only ignored on Android 11+), the storage permissions should be declared basically (always) in all Scopes (DefaultFileScope and FileScope) this way:
Note: If DefaultFileScope and the FileScope are both set to App, files are saved in the ASD with the File component. But on Android < 4.4 (< API 19, KitKat) READ & WRITE permissions are required.
In order for these permissions to both be declared in the Manifest, the default settings of the File component must be changed and both permissions must be enabled in the designer. So there is no (recognizable) reason why this option (ReadPermission, WritePermission) exists in the File component at all. Because both permissions are always required on Android < 4.4.
But if you then want to copy/move a file from the ASD to one of the Shared folders, WRITE permission is incorrectly requested even on Android 11+. This permission is
no longer available on Android 11+ and
is not required on Android 11+.
Can anyone make this even clearer? I wouldn't know how!
When even PUs (and apparently even the MIT team ) seem to have trouble understanding all this scope stuff, how will it be with the others?
This is why I have generally been pushing users to saving/storing/retrieving files in/to/from the ASD, which seems to be the most reliable and straightforward location, and to then work from there - either to attempt a copy/move to some shared storage, or just get the file off the device online somewhere.
Yes, but even with that, on Android < 4.4 (with the default settings of the File comp.), you'll have permission issues, as I explained earlier. Only not if both storage permission are enabled in the File comp. (in the designer).
This is only irrelevant for Kodular, because the minSdkVersion is 19 (Android 4.4, KitKat) there. But with AI2 the minSdkVersion is 7 (Android 2.1, Eclair).
Hi,
Now that I have followed all Your (Power Users) discussions around my questions about, "Question about Files, Scopes and Android Levels (US/EU)", have I become much wiser.
So, I have updated my system (according to Taifun's and Anke's informations) and now it's all working very well.
Although, I don't find the information about 'Scopes' in 'AI2's GUIDE' under 'File?/more information':
"File: Non-visible component for storing and retrieving files. Use this...",
particularly readable.
By that I mean, everything that is said about 'Scopes' and 'Default Scopes' isn't written, so everyone completely understands it or it's because I'm not American.
But thanks Taifun and Anke for your help, it was the right solution for me anyway