Photo gallery in app inventor, how to do?

1,030 views
Skip to first unread message

aikido.fac...@gmail.com

unread,
Sep 6, 2014, 2:38:59 AM9/6/14
to mitappinv...@googlegroups.com

I want to do a gallery on the basis of photo files from my apk. I do not want to open the gallery from the camera (as in imagepicker), but open image files of my application (without saving the images in a separate folder on the sd). Please help!

aikido.fac...@gmail.com

unread,
Sep 6, 2014, 2:46:07 AM9/6/14
to mitappinv...@googlegroups.com
Spotkałem się z Gallery Viewer ale nie wiem jak zainstalować plik :"Gallery Viewer" i skąd go pobrać

SteveJG

unread,
Sep 6, 2014, 7:46:27 AM9/6/14
to mitappinv...@googlegroups.com
Place the images you want into the resources (Media)  .  For example, one of the images could be called FirstImage.png

From the Designer screen, go to Media, press the Upload File button and follow the directions on the pop-up screens to load your images from a folder on your PC.


To retrieve on image, place an image control on your Android screen  and  set Image1.Picture to  FirstImage.png .

You can then select other images by putting the code into lots of buttons  .... Button1.Click >>>> set Image1.Picture to  FirstImage.png      Button2.Click >>>> set Image1.Picture to SecondImage.png     .   All the images go into a single Image1 component on the screen.

To make this work nice,  use a list picker to select the images    or   you could use a timer and the Control for each number from 1 to thenumberofimages by 1  to cycle through a list where the items in the list are:
Image1.png, Image2.png, Image3.png       for three images

Try some blocks. If  this advice works for you, rejoice with us.    If it does not work, show an image of what you tried and you will get advice.

Happy App Inventing!

Regards,
Steve



Filmon

unread,
Sep 6, 2014, 9:58:55 AM9/6/14
to mitappinv...@googlegroups.com
Hi!

I am making an app that showes songtext while the music is playing. I read your answer, SteveJG and I want to do in a similar way. But I can't get it to work, I don't really understund how to make one image to change it's source, I mean, to change the picture that it showes.

I did like this:

1. I draged an Image component to my screen/designer
2. I named this image to something like "ImageSongText"
3. I coded as you can see in the picture that I have attached.

But how can I choose the right imagefile? I have the image file already uploaded.

Regards Filmon
setimage.tiff

Filmon

unread,
Sep 6, 2014, 1:43:31 PM9/6/14
to mitappinv...@googlegroups.com
Hi!

The problem is solved now. I saw on the internet that I need to grab a text block and write the name of the file there.

//Filmon

SteveJG

unread,
Sep 6, 2014, 3:42:45 PM9/6/14
to
Great Filmon.    

@aikido    Here is your solution you might adapt:  https://groups.google.com/forum/#!category-topic/mitappinventortest/d5H7Np6GCSs

Regards,
Steve
Reply all
Reply to author
Forward
0 new messages