I need to create one smooth and nice image gallery (images in a GridView and each image can be zoomed in viewpager (swipe left/right) ) in my android application.
My pictures are available to be downloaded on Amazon S3.
Now, my question is what is the best way to download pictures from S3 and show them. For the moment, I am downloading the pictures from S3 (if they are not yet on sd card, with their library, TransferManager, in an asynctask), once downloaded to a specific folder in SD Card, I am showing the image through UNiversalImageLoader library. But I find the process a bit slow, and not so smooth, app is bugging a bit when there are a few images to be loaded (even if they are already downloaded to sd card). What should I change in my process ? Is it better to generate a dynamic url with amazon and then download it through a library? Is it the File.exists check (to see if I have to download pic or not) which is slow?
I need the following features for my gallery:
- view images in gallery (gridview)
- see if images are on sd card, if not download from s3, if on sd card, show them in gallery
- download to specific sd card location
- view each image in viewpager (swipe left/right)
Thanks for your help,
Henry
You can use the Picasso library. It is used to load and cache images you don't have to manage the image cache, the library does that for you. Example as follows,
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
Related
I need a help. In my android application, I have adding image option.Each time I can choose or take images and send the image to server. here
While sending the image ,I set the image to SD card and send it to server.
after successfully send to server,I removed the image from SD card.
after adding i am showing images from server to list view.
Each and every time I am adding images and showing it like this.
I can able to edit the images also by setting new images.
My problem is,
When editing how to solve cache problems in SD card
what library will be useful for this kind of process.
how to load the images from server in list view.
how to update the particular cell image.
how to manage efficient memory for storing images in SD card.
I'm currently working on an application in college. I have created several games incorporating lots of images. My lecturer however is not happy with the app loading the images from the drawable folder, he wants something more efficient on memory.
Just wondering if anyone knows any solution? i looked at lazyloader and asychronous loading but most examples use images from the web. I need an efficient way to load lots of high quality images from drawable folder to UI.
Here is your options:
Load images from drawable as is now
Reduce images size and use lower quality JPEG for mobile
Create download class and download images from server to SD card and use it from there
If you using images in your app, you can read them from drawable, SD card or online. The image have to be somewhere to load it.
When i develop a android app with download and caching image from internet, i see many app use MemoryLruCache or DiskLruCache to cache image after download. But i want to know why they use them, why don't use the way like: download image, then save image into sd card and after get image from sd card to show it( it is manual way).
I'm newbie in android dev. So please help me to understand it?
Thanks many many times.
well downloading a list of images from url will consume time and also fill up the user memory also....so its better to dynamically load images from url and make its cache and then preview the images from cache..
I hope you did got my point....check some example of lazy loading of image
I am running a web server and storing all my photos at a folder called photos. Now I want the android application to list all the photos under that particular folder(It can be a slide show or a grid view). I know how to load an image from a url . But I am really unsure about how to view all the images stored on a folder. Could someone please point me in the right direction.
Refer this for load web images in gridview
And this to load images from web by lazylist.
To get list of images from your folder. You need to read all file names in that folder by using FTPClient and put the filenames as url in the above method.
I would like to know the location of the stored thumbnails in android sdcard. I used the adb push service to upload images and videos to the sdcard. But even after deleting few images, my application is loading the thumbnails of the deleted images which is creating problems. When I click the thumbnails, instead of the corresponding image, some other image is opening. How to delete/ re-populate the thumbnails? Also How to load the original image of the clicked thumbnail? How does android retrieve the original image corresponding to its thumbnail? what's the mapping between these two?
Thanks in advance.
Well, if you are are using system intents, like ACTION_PICK, then you probably need run media scanner ( Applications > Dev Tools > Media Scanner )