Image libraries for android


Image library
Major image loading libraries in android are :

1.Picasso 
2.Glide 
3.Universal Image Loader
4.Fresco 

1.Picasso 
-----------------------

GRADLE

implementation 'com.squareup.picasso:picasso:2.71828'
Picasso.get()
    .load(url)
    .placeholder(R.drawable.user_placeholder)
    .error(R.drawable.user_placeholder_error)
    .into(imageView);

2.Glide 
---------------------
Gradle dependency:
repositories {
  mavenCentral()
  google()
}

dependencies {
  implementation 'com.github.bumptech.glide:glide:4.8.0'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
}
Glide.with(getApplication()).load(url)
        .centerCrop()
        .crossFade()
        .error(R.mipmap.ic_launcher)
        .diskCacheStrategy(DiskCacheStrategy.ALL)
        .into(imageView);

3.Universal Image Loader
---------------------------------------

Gradle dependency:
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
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);
For more Android-Universal-Image-Loader
  4.Fresco 
---------------------
Gradle dependency:

         implementation 'com.facebook.fresco:fresco:1.10.0'
Full details from here :Fresco

Comments :

Post a Comment