How to Load Images From URL using Glide in Android Java

In this article, we will learn how to Load Images from URL in Android Studio using Glide in Java. At the end of this tutorial, you will see the following screen will be designed.

Load Images From URL in Android


Add the following dependencies in your build.gradle.

implementation 'com.github.bumptech.glide:glide:4.12.0'

Make sure you Sync your project after adding the Glide.

Internet Permission

We are loading the images from the URLs with the help of the internet, that why INTERNET permission required.

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

URL for Images

We have the Images URLs and the path where we have to display the images.


We have create the XML files and displaying images in the ImageView.

MainActivity Code

In the the file we can load an image on click button and Glide code is written under setOnClickListener() function.

package com.example.handyopinion;

import android.os.Bundle;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.bumptech.glide.Glide;

public class MainActivity extends Activity {
    ImageView img;
    Button btn;

String url="";

    protected void onCreate(Bundle savedInstanceState) {

        img = (ImageView)findViewById(;
        btn = (Button)findViewById(;

        btn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

In this tutorial, we learn how to Load Images from URL with Glide, and we have learned how the library works and how we can integrate it into your project. 

If you have any questions or suggestions, feel free to ask in the comments section below.

Next Article

1. How to Load Multiple Images From URL in Android Using Picasso Kotlin
2. How to Save And Retrieve Class Object From Shared Preferences Using Gson Library in Kotlin Android Studio

Please share this post:
Posts created 41

Ask a Question

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

%d bloggers like this: