A simple library to display images in Android. Images are being downloaded asynchronously in the background. Images are being cached on SD card and in memory. Can also be used for GridView and ListView just to display images into an ImageView or any other View, even custom ones.
Originally published here.
We recommend to create your view and implement the ImageProcessingCallback there, specially for ListView and BaseAdapter. Check the ".impl" package.
//To use the default external folder, this folder will be deleted when the app no longer exists.
ImageLoader.getInstance().init(getApplicationContext());
//Or to use another folder, use...
//ImageLoader.getInstance().init(getApplicationContext(), "MyExternalFolder");
...
public class MyItemView extends LinearLayout implements ImageProcessingCallback {
...
//Do what you need in methods onImagePreProcessing() and onImageProcessing(Bitmap bitmap)
...
ImageLoader.getInstance().displayImage(data[position], myView);
Don't forget to add the following permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Now the ImageLoader is a Singleton, so you do not need to check for only one instance. But remember to call the init() method.
Check the ".impl" package to learn how to implement the library, it is very easy.
LazyList is released under the MIT license.