How To Load Image From URL To ImageView In Android Using Picasso

Picasso is A powerful image downloading and caching library for Android Applications.

Images add much-needed context and visual flair to Android applications. Picasso allows for hassle-free image loading in your application—often in one line of code!

Many common pitfalls of image loading on Android are handled automatically by Picasso:

  • Handling ImageView recycling and download cancelation in an adapter.
  • Complex image transformations with minimal memory use.
  • Automatic memory and disk caching.

Download

Download the latest AAR from Maven Central or grab via Gradle:

implementation 'com.squareup.picasso:picasso:2.71828'

or Maven:

<dependency>

<groupId>com.squareup.picasso</groupId>

<artifactId>picasso</artifactId>

<version>2.71828</version>

</dependency>

  • Add SDK and sync project :

  • We need to add Internet permission :

  • Use ImageView :

<ImageView
android:id=”@+id/picassoImage”
android:layout_width=”200dp”
android:layout_height=”200dp”
android:layout_centerInParent=”true”/>

  • Add This Code :

Picasso.get().load(“YOUR IMAGE URL”).into(YOUR imageView);
ex :
Picasso.get().load(“http://i.imgur.com/DvpvklR.png”).into(picassoImage);
And Run project.

  • Add Holder To Image (When the user have some Internet problems you show him the holder until the application download the image).
  • Copy and Paste image holder into drawable folder :

  • And Add .placeholder(“imageholder”) :

  • when you run your app you will see the holder 1st :

android picasso

For more Informations : Picasso

I hope that’s Clear & Simple.

have a good time.

Android Dev

Android Developer.

Leave a Reply

Your email address will not be published. Required fields are marked *