Components Camera and Image

I am having trouble displaying a photo taken with the camera component in the image component (after taking the photo the application does not display the photo in the image component) as coded. Does anyone have any idea what happens. I tried on 2 phones: a xiaomi with android 9 and a sony with android 5.1

Please show your relevant blocks

No, should work. Did you test with Companion or APK?

Yes. As previously mentioned, on 2 devices I downloaded using a qr code scanner. Is the problem with the qr code scanner? I’ll try to download it in another way to see if it works.

Does it work if you use Companion?

I don’t use companion. I usually download the app with the qr code. I now tried to download via Google Drive and I was also unsuccessful.

I provide the application link for testing.

You apk works OK for me (Genymotion Emulator Android 9)

Try this simple aia project (tested working compiled on HTC10 Android 7)
myphoto.aia (1.6 KB)

Your apk also didn’t show the photo in the image component

I have used that same code in a Xiaomi Android 9 and in an Android 5.1 and it works perfectly.

OK, so from testing, there is something different at your end, with two different devices ? (Xiaomi and Sony) Unlikely Android 9 or 5.1 the issue ?

What happens if you take a second photo - same problem ?

I tried several photos and nothing to show in the image component

I also tried it in another application that I did and it was working and now it also stopped showing the photo in the image component.

I’m going to lunch now. Thank you for trying to solve my problem. Later I will continue to research what happens.

Could you tell us a little bit more about your setup? The camera component writes the image to the path /sdcard/Pictures/app_inventor_system-time.jpg. If you have your phone plugged into a computer and the file system is mounted, then this path isn’t writeable, which might explain why it fails. If you use a file system viewer, can you see any app_inventor files in the Pictures directory, indicating that at least the image was written? You may also want to check the Settings app to confirm the app has permission to access storage (on the Android 9 phone).

1 Like

I can’t see any pictures taken in the app on my cell gallery (Xiaomi Redmi 7A). I created a Pictures folder but there are preceding directories other than the simple sdcard, as shown in the attachment

you created that directory on the external sdcard...
try to find the Pictures folder on the internal sdcard...
you might want to use a file manager app to do this...


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Hi Taifun. Always around here helping others. Cool. As for my problem, there is no Pictures directory on my internal storage. Image attachment exposing the directories of my cell phone. Note the structure of the internal storage.

See here:

and also here: