I have a ListView with ~100 large images. Each image is about 640.640 jpg and is shown 1/2 screen size. Typical gallery.
I am currently loading the images using the wonderful universal-image-loader-1.9.2.
ParseFile photoFile = p.getParseFile("imageFile");
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.displayImage( photoFile.getUrl(), theImageView );
Now, you get a bit of stutter on the ListView, when they are loading.
Now, coincidentally, I had the phone on a very slow WiFi network. IN FACT, IT WAS SMOOTH AS SILK.
At first, I couldn't work out why the sudden improvement! Serendipity!
In fact then, in that situation: is it worth staggering the calls to load the images?
So, I could leave 0.1" between each call, for example.
Or indeed, should I just do them one follows the other maybe?!
What's the deal there? Do all android engineers do this all the time? Cheers!
I've already applied all the other classical techniques I have googled up for buttery smooth ListView scrolling. Cheers
(Note that I have tried a number of systems to load the images, doesn't make a difference, it's not an issue with Universal Image Loader, which rocks.)
ashishduh, here's the code from getView ... as you see, it's trivial.
(note - setting the size makes no difference. if i try it with say 500.500 fixed, it's the same)
...
v.someTextView.setText(blah);
v.someTextView.setText(blah);
// and now the big image
if (p.containsKey("imageFile"))
{
// this cell has a big image
v.mainImage.setVisibility(View.VISIBLE);
ParseFile photoFile = p.getParseFile("imageFile");
// ...using p.getNumber("imageWidth").floatValue(); and height
// from the cloud, calculate needed width/height on the phone...
v.mainImage.getLayoutParams().width = Math.round(desiredGlassWidth);
v.mainImage.getLayoutParams().height = Math.round(desiredGlassHeight);
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.displayImage( photoFile.getUrl(), v.mainImage );
}
else
{
// this pcell has no big image
v.mainImageIV.setVisibility(View.GONE);
}
...