Take photo, save it and change filename

Use this as filename:
image

Try like this:

blocks (48)

1 Like

It is not recommended to use Async blocks unless you are dealing with big files or functions who highly affect main thread.

1 Like

Camera images are usually between 2 and 4 mb - big files!

1 Like

Then it's ok :sweat_smile:

1 Like

Works! Can I hide source of the photo and photo? I want only to save them.

1 Like

Yes, you don't need the label or the image component, they are just there for proof that it works! You might want to replace(in the "when TaifunFile1.Moved" event) with a notifier alert: "Image saved" or something similar....

1 Like

Check out this

Example.aia (2.2 KB)

1 Like

This is not working. I can't see saved picture in phone gallery. Do you know something about that?

2 Likes

Android version ?
File paths ?

Show your relevant blocks....

1 Like

this is the from example aia from @Oakchris1955
I tried on android 8, 9, and 10

2 Likes

and what exactly is not working?

Try in companion app and use Do It on your blocks to identify issues.

1 Like

Try this:

Android ≥ 10:

1 Like

On old android works. But in gallery shows only when I restart the phone (turn off and on).
On new android don't work at all..

1 Like

What doesn't work at all? The pic is created and saved in the ASD for Android 10+ devices.
But it seems that pics / images from the ASD are not shown in the Gallery.

On devices with Android < 10 you can try the TaifunTools.GalleryRefresh method.

yes, picture is saved, but it doesnt apear in the gallery after restarting a phone..
I tried gallery refresh metod, but im not sure if I put it right?

Yes, no image is displayed in the gallery that is saved in this path / folder or a subfolder:

/storage/emulated/0/Android/data/

So pictures from the ASD are also not shown in the Gallery. The GalleryRefresh method does not change this.

So how ti get pictures in gallery on new androrid 10+?

With this path (ASD) it will most likely not be possible. I think images need to be saved in the MediaStore for this.

You have to NOT store the image in the ASD, which is default for Android 10+... this will work until App Inventor still targets SDK29... and later see this document how to store to shared directories

Taifun