Create a folder and move a photo into it

I'm new. I just landed here.
I created a button to take a photo and now I want to save that photo to the sd card. I've been searching for hours on Google and on this forum and I only find contradictory messages that don't clarify much due to some change made by Android in the permissions (or something like that I understood). I also haven't managed to create a simple folder on the SD card to host the photo.
Is it so difficult to do this task in App Inventor?
I've tried some solutions and they didn't work, I assume it's because of the Android version.
Some solutions point to external extensions, but I don't really know how they work, or they mix things up with databases and I don't know if that's really what I need.
Others say that it can be done with extensions that launch Linux commands directly from App Inventor, which would be great for me, it would save me a lot of time, but I haven't managed to get it to work either.
How can something as apparently simple as creating a folder and hosting a file in it get so messed up?

I appreciate any help in advance.

Where exactly?

It doesn't really matter, for example in a folder called "myphotos" in the root of the sdcard. Or are you asking for a specific reason?

Which Android version device are you targeting?

You cannot create a folder at that location with Android version > 9, it would need to be in one of the Shared Directories (e.g. Pictures, Download, Documents etc.)

By default, photos taken from within an AI2 app are also stored in different places, depending on the Android version.

Android version > 10


See also here: https://community.appinventor.mit.edu/t/default-filescope-is-this-the-same-in-screen-and-file/44639/2

Okay, let's say we want to create the folder in Documents. So, what would be the simplest way to create a subfolder and move the photo I take there?

:\

@>-->---

Ups, sorry this was a topic only visible for power users.
Here is another one:

Use the File component for it. Create a new folder in /Documents first and then move the photo there. Storage permissions must only be requested on Android < 11.

The photo is stored in the ASD - application specific directory

To copy it to shared storage, use the file component and its Copy method

From scope is App
From filename is the image you get in the AfterPicture event
To scope is Shared
To filename is for example /Download/myPictures/myPicture.jpg

Just try something and if you got stuck, post a screenshot of your relevant blocks

See also Some basics on Android storage system

Taifun

1 Like

To make sure we're talking about the same thing, first take a look at the guide @Taifun mentioned (especially regarding "External Storage": SD card, removable/micro SD card, ...).

@Anke Thank you for clarifying...

There are several topics that are restricted to PUs only...

https://community.appinventor.mit.edu/t/learning-discourse/55/6

It is quite frustrating to come across this. The poor self-taught user, who is not formulating insipid questions with each step or with each challenge and seeks information on the Forum, finds out that he cannot advance because there is privileged or elitized information to which he does not in access. Sad.

@>-->---

Well, there are good reasons why some topics are not posted publicly, but are discussed/clarified internally within the PUs to avoid additional confusion among users.

But you are right in that there are also topics where the result of an internal PU discussion would have been helpful for other users as well.

1 Like

My last post in this "PU topic":

So I tried to make this topic public (but it wasn't mine).

1 Like

What exactly prevents you from following my suggestion?

Taifun

Nothing.

@>-->---

...if the DefaultFileScope is set to "App". If it is set to "Shared" the picture is saved in the Shared folder /Pictures.

2 Likes

Ok, great...
So in case you need more help, then just provide a screenshot of your relevant blocks

Taifun

1 Like

Now moved to General Discussion, so should be visible to all. (As PU you could have done this)

(We will never be able to find it again now :wink: )

1 Like

As I said

And I won't do anything like that without the OP's (author's) permission. :smiley: