0

I am making a gallery for my application in which the images are on the serve. There are total of 4 images in my database. What i want is to retrieve those images and show them on the gallery.

I came across many examples from "SO" and http://w2davids.wordpress.com/android-3-0-%E2%80%93-photo-gallery-example/ which takes images from drawables.

The Confusion is when i retrieve the images from the database should i directly show them in the gallery or first save the images on the sd-card and then display them in the gallery. Which is the better and efficient option i can use.

Also if someone could help me out in showing the images directly from the network rather than drawables.

I would be glad if someone could help me out of this. Thank You!

Droid
  • 419
  • 4
  • 15

1 Answers1

1

I will suggest you to take a look at good library Universal Image Loader. This library have following features.

  • Multithread image loading
  • Possibility of wide tuning ImageLoader's configuration (thread executors, downlaoder, decoder, memory and disc cache, display image options, and others)
  • Possibility of image caching in memory and/or on device's file sysytem (or SD card)
  • Possibility to "listen" loading process
  • Possibility to customize every display image call with separated options
  • Widget support

enter image description here

Chintan Rathod
  • 25,864
  • 13
  • 83
  • 93
  • hey i went through the code but now the problem i am facing is that all my images are on the server. Wen i retrieve it its in the bitmap form, should i save it in drawables and then show in the gallery or should i directly save it in Integer array and show them in the gallery.. I am confused. – Droid Jul 12 '13 at 06:53
  • Um.. there is one option like you can save it in cache memory. And first of all, "Drawable" is static till you are building your application and those are in drawable directory. Of course you can convert image to Drwable or Bitmap as you need it. But ImageView provide option of both like you can set drawable as image to it and also bitmap. But I will recommend you not to store images as drawable in your project coz there is limited HEAP size provided by OS to your application. I have faced problem of Out Of Memory. So use that library with different parameters and you are done with. :) – Chintan Rathod Jul 12 '13 at 06:59
  • Ohh Thank you soo much for your help @Chintan. Will surely work it out and get back to you when done. – Droid Jul 12 '13 at 07:13
  • hey i have done some-part can you please assist me on that. This is the link http://stackoverflow.com/questions/17651726/image-gallery-does-not-show-anything – Droid Jul 15 '13 at 10:17