nostra13 /Android-Universal-Image-Loader

Powerful and flexible library for loading, caching and displaying images on Android.

★ 16,787⑂ 5,988👁 1,313⑃ 153● 1,230▤ 0
JavaApache-2.0Created 2011-11-27
+0
日增长
16,787
stars
5,988
forks
1,313
watchers
153
prs
1,230
issues
0
releases

README

!Logo Universal Image Loader  

The great ancestor of modern image-loading libraries :)  
UIL aims to provide a powerful, flexible and highly customizable instrument for image loading, caching and displaying. It provides a lot of configuration options and good control over the image loading and caching process.

!Screenshot

 Project News 
  Really have no time for development... so I stop project maintaining since Nov 27 :(
  UIL [27.11.2011 - 27.11.2015]
  Thanks to all developers for your support :)

 Features
  Multi-thread image loading (async or sync)
  Wide customization of ImageLoader's configuration (thread executors, downloader, decoder, memory and disk cache, display image options, etc.)
  Many customization options for every display image call (stub images, caching switch, decoding options, Bitmap processing and displaying, etc.)
  Image caching in memory and/or on disk (device's file system or SD card)
  Listening loading process (including downloading progress)

Android 4.1+ support

 Downloads
  universal-image-loader-1.9.5.jar
    

 Documentation
  Quick Setup
  Configuration
  Display Options
  Useful Info - Read it before asking a question
  User Support - Read it before creating new issue
  Sample project - Learn it to understand the right way of library usage
  ChangeLog - Info about API changes is here

 Usage

 Dependency


implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'


 Acceptable URIs examples
 java
"http://site.com/image.png" // from Web
"file:///mnt/sdcard/image.png" // from SD card
"file:///mnt/sdcard/video.mp4" // from SD card (video thumbnail)
"content://media/external/images/media/13" // from content provider
"content://media/external/video/media/13" // from content provider (video thumbnail)
"assets://image.png" // from assets
"drawable://" + R.drawable.img // from drawables (non-9patch images)

NOTE: Use drawable:// only if you really need it! Always consider the native way to load drawables - ImageView.setImageResource(...) instead of using of ImageLoader.

 Simple
 java
ImageLoader imageLoader = ImageLoader.getInstance(); // Get singleton instance

 java
// Load image, decode it to Bitmap and display Bitmap in ImageView (or any other view 
//	which implements ImageAware interface)
imageLoader.displayImage(imageUri, imageView);

 java
// 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
	}
});

 java
// Load image, decode it to Bitmap and return Bitmap synchronously
Bitmap bmp = imageLoader.loadImageSync(imageUri);


 Complete
 java
// 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 onLoadin

Top issues

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON