```
// Get singleton instance
ImageLoader imageLoader = ImageLoader.getInstance();
```
```
// Load image, decode it to Bitmap and
// display Bitmap in ImageView (or any other view
// which implements ImageAware interface)
imageLoader.displayImage(imageUri, imageView);
```
```
// Load image, decode it to Bitmap and return Bitmap to callback
imageLoader.loadImage(imageUri, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
// Do whatever you want with Bitmap
}
});
```
```
// Load image, decode it to Bitmap
// and return Bitmap synchronously
Bitmap bmp = imageLoader.loadImageSync(imageUri);
```
```
// Load image, decode it to Bitmap and display
// Bitmap in ImageView (or any other view
// which implements ImageAware interface)
imageLoader.displayImage(imageUri, imageView, options, new ImageLoadingListener() {
@Override
public void onLoadingStarted(String imageUri, View view) {
...
}
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
...
}
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
...
}
@Override
public void onLoadingCancelled(String imageUri, View view) {
...
}
}, new ImageLoadingProgressListener() {
@Override
public void onProgressUpdate(String imageUri, View view, int current, int total) {
...
}
});
```
```
// Load image, decode it to Bitmap and return Bitmap to callback
// result Bitmap will be fit to this size
ImageSize targetSize = new ImageSize(80, 50);
imageLoader.loadImage(imageUri, targetSize, options, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
// Do whatever you want with Bitmap
}
});
```
```
// Load image, decode it to Bitmap and return Bitmap synchronously
// result Bitmap will be fit to this size
ImageSize targetSize = new ImageSize(80, 50);
Bitmap bmp = imageLoader.loadImageSync(imageUri, targetSize, options);
```