Image Loading Libraries Picasso and Glide

Image Loading Libraries: Picasso and Glide

Glide and Picasso are the most used image loading libraries in Android applications.

Picasso:

Picasso downloads the image and stores the full-size image in the cache
and whenever we ask for the same image, it will return the full-size image and resize them to fit into the ImageView in real time.

 
Adding Picasso to our app/build.gradle file:
dependencies {
    implementation 'com.squareup.picasso:picasso:2.5.1'
}

//Sample code to load image from URL using Picasso
String imageUri = "**********************";
ImageView image = (ImageView) findViewById(R.id.image);
Picasso.with(context).load(imageUri).into(image);

Both libraries has their own use, If you want small use of image you should go for Picasso but if you have lot of images use and memory management you should go for glide.

Glide:

Glide works differently. Glide downloads the image from the given URL, resize it to the size of the image view and stores it to the disk cache.
So if you are loading the same image in two different sized image views, Glide will store two different copies of the same image in the cache with different resolutions.

Glide is recommended by Google. It provides animated GIF support and handles image loading/caching.

Adding Glide to our app/build.gradle file:
dependencies {
    implementation 'com.github.bumptech.glide:glide:3.5.2'

}

//Sample code to load image from URL using Glide
String imageUri = "**********************";
ImageView image = (ImageView) findViewById(R.id.image);
Glide.with(context)
    .load(imageUri)
    .into(image);

References:

https://square.github.io/picasso/

https://github.com/bumptech/glide/wiki