Skip to content

A lightweight library for Android developers to deal with image downloading, fast and simple!

Notifications You must be signed in to change notification settings

dilyar85/Android-ImageLoader

Repository files navigation

Android ImageLoader

A lightweight library for developers to deal with image downloading, fast and simple!

  • Fetching and displaying images with only one line of code
  • Includes image size adjustment to display it properly
  • Available on jCenter and Maven Central
View it from JFrog

Usage

To load online images:

ImageLoader.getInstance().loadImageWithUrl("IMAGE_URL", "YOUR_IMAGE_VIEW");

To load local images:

ImageLoader.getInstance().loadImageWithPath("IMAGE_PATH", "YOUR_IMAGE_VIEW")

That's right, just one line code will work. If you want to, you can also listen the change of loading. Just implement the ImageLoader.CallbackListener and override its finishLoadingImage() method. For example:

public class MyActivity extends Activity implements ImageLoader.CallbackListener {
	
	@Override
    protected void onCreate(Bundle savedInstanceState) {
    	...
    	ImageLoader.getInstance().setCallbackListener(this);
    	...
    }

    ...


	@Override
    public void finishLoadingImage() {

    	//Image has been displayed in ImageView now.

    }
    ...


} 

Installation

dependencies {
    compile 'com.github.dilyar85:imageloader:0.1.1'
}

Do not forget to declare permission in AndroidManifest.xml

 <uses-permission android:name="android.permission.INTERNET"></uses-permission>
 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>

Additional Features

This ImageLoader uses LruCache so it would not redownload the images that were recelently displayed.
It would also crop the image to iamgeview's size before downloading, which will defenately make user save their data and make loading images fast.

License

Licensed under Apache 2.0

About

A lightweight library for Android developers to deal with image downloading, fast and simple!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages