I'm having problems with the file system/file structure on Android/AI2

Hi everyone,

I'm new programming apps in MIT app inventor. I want to create an app taking pictures and renaming them, and exporting an csv file with the data and photo numbers.

My problem:
if I set "Screen to Legacy" the csv export works and the file is ok, but the pictures are not renamed

if I set "Screen to App" renaming and saving of the pictures works, but not the csv file, its not there

I'm very new to programming apps, so I might make the most stupid mistakes, I'm sry for that already.

Thanks for this forum, it already helped me so much.

Warm regards,

Fotos.aia (47.4 KB)

I moved your question to a new topic as it has nothing (not much) to do with MANAGE_EXTERNAL_STORAGE. Apart from that, you should know that this permission is not allowed by Google. This would only be considered if the app is only to be distributed for private purposes or to individual users (without the Play Store).

Ich habe deine Frage in ein neues topic überführt (verschoben), da das nichts (bzw. nicht viel) mit MANAGE_EXTERNAL_STORAGE zu tun hat. Abgesehen davon solltest du wissen, dass diese permission nicht von Google zugelassen wird. Diese würde also nur in Betracht kommen, wenn die App nur für private Zwecke oder an einzelne Nutzer (ohne den Play Store) distribuiert werden soll.

Please read this first:

Hello Anja

The confusion over the file system has been brought about by Google introducing extra security measures. There is a Guide by my fellow Power User Anke:

And please explain why the csv file should / must be stored in the root directory of the external storage. Why not in one of the Shared folders /Documents or /Download or a respective subdirectory within it? Or in the ASD (App-specific directory)?

If you save there, no storage permission will be requested at all on Android 11+ (as long as the File component is not used). On Android < 11, only WRITE permission is required, since WRITE implicitly includes READ permission.

Where are your files ? show please your blocks

There is a link to a Project file in the 2nd Post.

First of all, thank you for your reply, that is fantastic!
I'm ok saving it anywhere, as long as I can share the data, via Email and can see the files on the phone. Before that I could not even see the files because it was in the internal storage and not accessible due to Android 11.
My aim is to share the renamed photos and the .csv out of the phone.

The internal storage is not accessable on any Android version without a rooted device.

But you can check it using the File component or my MFile or one of the two File extensions from @Taifun or @vknow360.

As I said, read the topics that I mentioned, first. And avoiding storage permissions on Android 11+ when saving the csv file (in one of the Shared folders) use my MFile extension.

You should definitely become familiar with how to debug your blocks.
This greatly simplifies troubleshooting!

Here is an example of your blocks:

See e.g. here (→ point 4):

1 Like

@Plecotus It seems you've solved it now. So close the topic by clicking Solution on the answer that helped you the most so that others can learn from it too.

1 Like

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