Having the user take a photo with the camera

Hey Taifun, now that I think about it, I already want access to all media when the screen is activated. It also asks for camera access when I press the button. Then the problem is caused by something else.

Hey, I found it. First of all, I select a picture for Picture 2 from the gallery, then I adjust the first picture I took with the camera, it adjusts, there is no problem, But instead of the other photos I took, he puts the first photo

Great
However I did not understand your explanations

Taifun

Sorry, I’m using translation so you might not understand.First of all, I have a picture component named picture2. I show the picture taken or selected by the user to the user from there. If picture2 is empty, when I take a picture, it does not transfer the picture there first I have to select a picture and then take a picture and it transfers the first picture I took, no problem, but when I take another picture it does not transfer that one, it transfers the first picture I took instead. I hope you understand

What about providing a screenshot of your relevant blocks?
Taifun

1 Like

Oh we couldn’t get along :grin:


IMG_20231114_015838

Why are you still using the AfterPicture event?
One of issue in Kodular is, that this event does not fire anymore…
Remember, therefore we are using the workaround

Taifun

Are you telling me to do this?

I did as you said, but the problem now is, First of all, I take a picture from the camera, it transfers the picture to Picture 2, but when I take another picture, it does not transfer it, other than storing the picture first.If I replace it with an image and then take a photo from the camera, the photo changes

For me the blocks look fine
I currently do not have another recommendation

Taifun

I don’t know but there is a problem, it is very different, taking a photo with the camera shouldn’t be this difficult.
Thanks for your help
@bodymindpower What do you think causes the problem?

Hey Taifun I tested 4 of my devices now.

Android 10 Worked

Android 11 Didn’t work

Android 8.1.0 Worked

Android 8.0.0 Worked

Only it did not work on Android 11, that is, on Android 11 devices. First, I take a picture, it transfers the picture to Picture 2, then when I take a picture again, it does not transfer, it always transfers the first picture I took.

what if you delete the image after copy to asd so its always the first image?

Makes sense, but how?

use file component
before call camera take picture delete the file first

IMG_20231115_123356

Did I Do It Right?

This did not work, it still transfers the first picture

Pictures is a directory, but not a filename
use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing and Debugging
Taifun

So how do I delete the file?

Get the path to the file…

Ask yourself: where did you already get it? And how do you have been able to display the file in an image component?

Learn to use Do it

Taifun

A post was split to a new topic: Issue while copying blocks