Android-Universal-Image-Loader README

The project's README from github.com/nostra13/Android-Universal-Image-Loader. As one markdown file: README.md.

Logo Universal Image Loader Build Status Maven Central

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

Features

Android 4.1+ support

Downloads

Documentation

Usage

Dependency

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

Acceptable URIs examples

"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

ImageLoader imageLoader = ImageLoader.getInstance(); // Get singleton instance
// 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);

Complete

// 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
ImageSize targetSize = new ImageSize(80, 50); // result Bitmap will be fit to this size
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
ImageSize targetSize = new ImageSize(80, 50); // result Bitmap will be fit to this size
Bitmap bmp = imageLoader.loadImageSync(imageUri, targetSize, options);

Load & Display Task Flow

Task Flow

Applications using Universal Image Loader

MediaHouse, UPnP/DLNA Browser | Prezzi Benzina (AndroidFuel) | ROM Toolbox Lite, Pro | Stadium Astro | Chef Astro | Sporee - Live Soccer Scores | EyeEm - Photo Filter Camera | Topface - meeting is easy | reddit is fun | Diaro - personal diary | Meetup | Vingle - Magazines by Fans | Anime Music Radio | WidgetLocker Theme Viewer | ShortBlogger for Tumblr | SnapDish Food Camera | Twitch | TVShow Time, TV show guide | Planning Center Services | Lapse It | My Cloud Player for SoundCloud | SoundTracking | LoopLR Social Video | Hír24 | Immobilien Scout24 | Lieferheld - Pizza Pasta Sushi | Loocator: free sex datings | 벨팡-개편 이벤트,컬러링,벨소리,무료,최신가요,링투유 | Streambels AirPlay/DLNA Player | Ship Mate - All Cruise Lines | Disk & Storage Analyzer | 糗事百科 | Balance BY | Anti Theft Alarm - Security | XiiaLive™ - Internet Radio | Bandsintown Concerts | Save As Web Archive | MCPE STORE -Download MCPE file | All-In-One Toolbox (29 Tools) | Zaim | Calculator Plus Free | Truedialer by Truecaller | DoggCatcher Podcast Player | PingTools Network Utilities | The Traveler | minube: travel photo album | Wear Store for Wear Apps | Cast Store for Chromecast Apps | WebMoney Keeper

Donation

You can support the project and thank the author for his hard work :)

Alternative libraries

Android-Universal-Image-Loader (nostra13/Android-Universal-Image-Loader)

display
Searching Database…

What is this?Universal Image Loader (UIL) is a Java library for Android that loads, caches and displays images. It offers lots of configuration options and fine control over the loading and caching process.
Is it an app I install, or a library for my code?A library, not a standalone app: you add it to your Android project as a dependency or a single .jar and call it from code whenever an ImageView needs an image.
How do I get it into my project?Add it as a Gradle or Maven dependency (see Usage in the README) or drop in universal-image-loader-1.9.5.jar. The docs include a Quick Setup guide and a sample project showing the right way to use it.
Will it run on my Android version?It supports Android 4.1 and up - that is the only requirement the README mentions; there are no other prerequisites beyond adding the library itself.
Is the library still maintained?No. The author stopped maintaining it in November 2015, and the README itself lists Fresco, Glide, Picasso and Volley as alternative libraries - new projects should look there first.
How much can I customize the image loading process?A lot: you can configure thread executors, the downloader and the decoder, memory and disk caches, and per-call display options such as stub images, caching switches, decoding options and Bitmap processing.
Can I track image loading progress?Yes. You can listen to the whole loading process, including download progress - handy for large images on slow connections.
What image sources can I load from?The README documents acceptable URI examples, including drawable://. The author advises drawable:// only when you really need it - the native ImageView.setImageResource(...) is preferred for drawables.
Is it battle-tested in real apps?Yes - the README lists dozens of apps built with it, including Twitch, reddit is fun, ROM Toolbox, EyeEm and TVShow Time.
Creator
nostra13
Size
26.5 MB
Stars
16.8K
Updated
CommitMay 17
Age
14y
Commits · 90 Days