Loading​ image from gallery to ImageView in Sketchware

To load an image from gallery to an ImageView in Sketchware app, follow the steps given below.

1. In VIEW area of Sketchware project add a Button button1, and an ImageView imageview1.
2. Set an image as default image of imageview1.

3. Create a new FilePicker picker component for picking images.

4. Now create a new String List list.

5. In the event on button1 Click , use the block
FilePicker picker pick files.
This will open the gallery when button1 is clicked, and allow users to pick any image.

6. In EVENT area add a new event FilePicker onFilesPicked under Component section.

7. In the event FilePicker onFilesPicked use the blocks:
ImageView imageview1 set image from file path ....
get at 0 of List String : filePath
as shown in image below, to set the selected image as image of imageview1.

8. Save and Run the project. Now when the user clicks button1, he can browse through gallery and select an image. The selected image will be displayed in imageview1.

Watch the videos below.
i. Pick a single image from gallery.

ii. Pick multiple images from gallery.


  1. Works good. But now its useless because when you close app and open it next time, an image is not saved on imageview. Would be nice to get code how to save an image permanently. Thanks,

    1. You can convert the Uri to String and store it in file shared preferences. And in onCreate convert the stored String to Uri, and set it as imageUri.

      Another way is to store image in app Cache.

    2. I try but its not working, its always null return, can you write the example?

    3. Good afternoon, I managed to solve the problem as shown in the images below, I don't know if it is the best way, but it is the one that I managed to solve the problem.
      PS. I'm sorry for being in Portuguese in the images because I translated my Sketchware.



      Now I want a way to combine text and image (exporting everything in a single image) without using a screenshot and saving to a specific location or database.

      If anyone knows how to do it I am very grateful.

  2. Heyyy,you're awesome.. I just ask it couple hour and voilaa.. it's done.. awesommee..
    But I think it's more awesome if we can make a dialogue wheter choose from gallery or take a picture, right?
    Can u make it?😅

  3. Plz make a video how to save image into File SharedPreferences .

  4. This comment has been removed by the author.

  5. Ciao Sanjeev faccio davvero molta fatica ad inserire un'immagine dalla mia galleria su "image manager" cosa posso fare?

  6. Result in null i want to change backgroud of edittext how to give working result

    1. In properties of edittext, you can change it's background.

  7. Put I want to upload image gallery to edittext background

  8. It works but I want it to be opened in another page ( Exmpl- page2 ) . Can you help

  9. And want to edit that selected picture. Plz help

  10. im trying to allow users to add images to a gallery and would love some help

  11. Its not work, everytime shows a transparent image, and i can't see the image that i have choosed, what can i do??

  12. Hi please I want to make a fashion app to display more fashion pictures in different categories using sketchware. Please help me out.

  13. Ayuda quiero subir imagenes para compartir con el público, pero que sea de forma permanente. Seria de gran ayuda un video. Gracias.

  14. Hello. How to pick an image to set background linear directly ? It's possible? Thanks.

  15. The path uri cannot contain path elements error
    How can I solve this problem?

  16. Hello. How do you do this from linear1?

  17. Hey, please what is the code to add for file pick.
    Using add source directly

  18. This code doen't work for the New Android version.

  19. This comment has been removed by the author.

  20. how can i upload multiple images to firebase at a time and load them in listview?

  21. I have problem with "get 0 of List String : filePath" block


Post a Comment

Popular posts from this blog

Create Music Player app in Sketchware

A Flash Light App in Sketchware

Admob rewarded video Ads in Sketchware

Firebase auth in Sketchware for Login Activity

Simple car racing android game in Sketchware