Glide is one of the most popular library for android. It is very simple and powerful library for image downloading. Glide is an open source media management framework for Android that wraps media decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.

First Add Dependency: –

compile ‘com.github.bumptech.glide:glide:3.7.0’

JavaFile:- GlideExample.java

package jeevan.karan.pecaso;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import jeevan.karan.R;
public class GlideExample extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ImageView imageView = (ImageView) findViewById(R.id.imageview);

Glide.with(mContext).load(“https://cms-assets.tutsplus.com/uploads/users/21/posts/19431/featured_image/CodeFeature.jpg”)

.thumbnail(0.5f)

.crossFade()

.diskCacheStrategy(DiskCacheStrategy.ALL)

.into(imageView);
}
}

XML file activity_main.xml:-

<?xml version=”1.0″ encoding=”utf-8″?>
<RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:tools=”http://schemas.android.com/tools”
android:id=”@+id/activity_main”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:gravity=”center”
>

<ImageView
android:id=”@+id/imageview”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:src=”@drawable/cat” />
</RelativeLayout>