How to Load Multiple Images From URL in Android Using Glide Kotlin

In this article, we will learn how to Load Multiple Images from URL in Android Studio using Glide in Kotlin. We can import images in the form of URLs and display them in the RecyclerView. At the end of this tutorial, you will see the following screen will be designed.

Load Multiple Images From URL - Handy Opinion


After creating a new project, 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 we need to include the permission of the INTERNET in our AndroidManifest.xml file.

<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.

Glide.with(context).load(ImgUrls[i]).override(800, 800).into(viewHolder.img_android)

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

Create a DataAdapter

We have to create an DataAdapter class by doing this we can populate data to our RecyclerView.

package com.example.handyopinionpicasso

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import java.util.*

class DataAdapter(
    private val context: Context,
    private val ImgUrls: ArrayList<String>
) :
    RecyclerView.Adapter<DataAdapter.ViewHolder>() {
    override fun onCreateViewHolder(viewGroup: ViewGroup, i: Int): ViewHolder {
        val view = LayoutInflater.from(viewGroup.context)
            .inflate(R.layout.row_layout, viewGroup, false)
        return ViewHolder(view)

    override fun onBindViewHolder(viewHolder: ViewHolder, i: Int) {
//        Log.e("URLS: ", ImgUrls[i])
        Glide.with(context).load(ImgUrls[i]).override(800, 800).into(viewHolder.img_android)

    override fun getItemCount(): Int {
        return ImgUrls.size

    inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {

        var img_android: ImageView

        init {
            img_android =
                view.findViewById<View>( as ImageView


MainActivity Code

package com.example.handyopinionpicasso

import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import java.util.*

class MainActivity : AppCompatActivity() {
    var ImgUrls: ArrayList<String> = ArrayList()
    var recyclerView: RecyclerView? = null
    var Manager: LinearLayoutManager? = null
    var adapter: DataAdapter? = null
    override fun onCreate(savedInstanceState: Bundle?) {

        recyclerView = findViewById<View>( as RecyclerView
        Manager = LinearLayoutManager(this)
        recyclerView!!.layoutManager = Manager
        adapter = DataAdapter(this,ImgUrls)
        recyclerView!!.adapter = adapter

In this tutorial, we learn how to Load Multiple 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: