How to Load Images From URL Using Picasso in Android Java

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

Load Images From URL Using Picasso


Add the following dependencies in your build.gradle.

implementation 'com.squareup.picasso:picasso:2.5.2'

Sync your project after adding the Picasso.

Add Internet Permission

To load images from the internet we are using the URLs and we also need to include the permission of the INTERNET in our AndroidManifest.xml file.

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

Add the permission when you need to load images from the internet.

URL for Images

We have the URLs of the Images and also the paths where need to display the images.


MainActivity Code

We can load an image by pressing the button and Picasso 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.squareup.picasso.Picasso;

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 the Image from URLs with Picasso, and we have learned how the library works and how we can integrate it into your project. Picasso documentation.

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

Next Article

1. How to Load Images From URL Using Glide in Android Java
2. How to Load Multiple Images From URL in Android Using Picasso Kotlin

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: