Canvas - Save to Downloads Folder

Good Day Everyone,

Can someone help me save my Canvas Drawing in Downloads Folder? so I can view it on my phone gallery.

I was able to save the canvas but the location of the image where put in android/data/kodularapp/canvas.png folder of the app.

Here’s My code for saving the canvas:
saved

Thank you!

where is the storage path? permission block to access internal storage?

You have set only save as…

No, but you can copy / move it (from the ASD) to one of the Shared folders

  • /Download
  • /Documents
  • /Pictures
  • /DICM

(using one of the file extensions from @Taifun or @vknow360) and then it should be shown in the Gallery.

Note: The Canvas component requires incorrectly WRITE permission, although it is saved in the ASD on devices with Android ≥ 10. This is a bug. @pavi2410

1 Like

Btw, it should soon be possible to do this directly without any extension:

Not all components have been updated with the Android 11 changes, which I believe even App Inventor haven’t as well.

Thanks for letting us know!

1 Like

Yes, sad, but true. :wink:

7 posts were split to a new topic: Issues in uploading a file using TaifunFTP

I am unable to save a canvas image on my phone. It’s working fine when I try the apk file. However, when I uploaded it to the Play Store, the canvas image, after saving, didn’t show up in my gallery.
Please help me find the mistake in my blocks.

To save canvas image -

To Take permission:

Also using @bodymindpower DeclareReadWrite Extension.

Note: I have tried the whole community thread and have implied them one by one on my app, but it still doesn’t work. This method works well, but I don’t know what happened after I uploaded it to the Play Store.

Do you have any solution @Still-learning

May be this will work in lower end devices…

Which Android version you are testing??

If the api fmgreater thn 29 then you should move the file from app to legacy mode using file component

Android 33 buddy.
It works after pressing save button 3times

I m using the wrong blocks buddy?

Btw how are you whats going on in your life?

do not use the first GalleryRefresh block… this does not make sense…
obviously you only have to do a gallery refresh of the image after copying…
and to simplify a little bit:


also use Do it to debug your blocks

this sounds strange… becasue you are incrementing the counter each time you press save… i.e. each time the file name is different…

Taifun

I tried your method but got the same result.

The modified blocks -

See, its not about files name. In my opinion it takes 3 times to create a folder/pattern to save images.

1st & 2nd time i click save i got this error -

3rd time it save successfully in my phone (Android 13).

In the first screenshot you tried to save QRCode-2.png, but got an access error, probably because that file already exists

In the second screenshot you stored QRCode-1.png successfully

Before start testing, delete all those already stored images QRCode-*.png…

Taifun

1 Like

Sorry for making u confused. Forget that QRCode -2.png and QRCode -1.png. I just share random screenshots. And Yes i deleted all the images & also reinstall the app before taking them.

Here i did it once again to show u in the right order, sorry once again.

1st try to save-

2nd try to save-

3rd try to save-

And in 3rd try it saved as QRCode -3.png

test your blocks step by step until you find where the error message is coming from

  1. save the canvas in ASD
    if it works
  2. copy the file to /Pictures
    if it works
  3. gallery refresh

you also can try to use the CopyAsxnc block from the file component and continue with the logic in the Copied event to refresh the gallery

Taifun

1 Like