My task is to download the images URL using Rest
call and render them into ListView
using Android adapter
. For making Rest
call I am using retrofit
which is returning a Json
(that Json have URL of images).
I am using picasso
to download the images from server and rendering them into Listview
. Everything works fine because I only have couple of Images to download right now.
How can I achieve the task when I will have more than 500 Images to download. What would be the best way to do it.
MyAdapter class
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView = (ImageView) convertView.findViewById(R.id.imageView);
Picasso
.with(context)
.load("http://i.imgur.com/rFLNqWI.jpg")
.transform(imageTransformation)
.into(imageView);
return convertView;
}
Above code is very simple i.e. rendering the one image on the basis of count. Any help would be appreciable.
Is this the right way to run the loop on the basis of count(imagesURL)
and download them using picasso
in above code? Or is there are any better solution ?
Edit-2
I think I misunderstood you guys. My question is How to implement above scenario when I will have 1000 images URL.