Image cannot load the file canvas saved

using the code below i tried to set a image component’s image to canvas save path but the image is blank
list view image and text have same issue
image

ive tried to use root explorer to check asd and the file is present correctly
ive tried to change target api to a9 or try on real android 7 device both dont work

Use Do it onto the Canvas.Save block and try a full or absolute path to the image

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

@Taifun
i have tried this
i got
file:///storage/emulated/0/Android/data/io.makeroid.companion/files/image%3A52030.png
which matches the path i checked with root explorer
i tried just set the image with this string also didnt work
i think the problem is image componant is not able to read from asd
is there any solution without extension

This is a full path
Now try an absolute path, i.e. remove file:// to get /storage/emulated/... abd try this. .
And try a relative path, which starts with /Android/data/...
Taifun

absolute path worked
thanks allot

But that only applies to ASD. If you want to assign an image via this path /storage/emulated/0/Pictures/Audi.jpg, it won’t work. Then a full path is required. What logic lies behind this remains a mystery (like so many other things).

Btw, AI2 doesn’t have this problem. @pavi2410

2 Likes

I’ll have a look. It should be 1:1 with AI2

ok this problem came bite me back again


previously im in another screen and everything works
i tried to implement similar thing in screen1 and it stopped working again all path didnt work on asd
and full path works outside asd
idk why
this problem is on companion and apk
ive tried all way and using exact same code in one screen it works in other it doesnt
what makes it even weirder is that listviewimageandtext works normally with same path idk how
i thought the image component i copyed is croupted so i tried adding another one and it still didnt work
@Taifun please help

Follow this tip

and for shared storage make sure you have read media images permission

Taifun

yes i know that
i want to acess file in asd and in one screen it worked so permission is granted(not needed for asd anyways)
i just think may as well try it in shared storage

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