In this Tutorial, we’ll learn how to work with Picasso Library for Android, Picasso is a library maintained by Square. It is one of the best ways to deal with images in your Android projects.

Why should I use Picasso Library for Android ?

Picasso is an Image Library created to make image displaying faster and hence simplifying the process. You will have to include only few lines of code if you decide to go with Picasso. The library takes care of HTTP Request, caching of images etc., it also allows you to debug, hence making your coding life easier.

Picasso library itself handles most of the process for you, like making Http Requests, caching the image, thus avoiding manual writing of code.

Integrate Picasso in your Android project.

You can download Picasso Jar File from Picasso Website

If you are using Android Studio you can add compile compile ‘com.squareup.picasso:picasso:2.5.2’ to your build.gradle file under the dependency section.

Picasso library for Android example

In your XML Specify :

In java class file you need to specify :

ImageView imageView = (ImageView) findViewById(R.id.picassoimageview);

Picasso.with(this).load(“https://”).into(imageView);

Basic syntax of Picasso ->

Picasso.with(context).load(“location of the image file”).into(“your imageview”);

Using Picasso with custom adapter example :

Using Picasso with drawable or assets or device storage :

Picasso.with(context).load(R.drawable.anyimage).into(imageView1);
Picasso.with(context).load(“file:///android_asset/anyimage.png”).into(imageView2);
Picasso.with(context).load(new File(…)).into(imageView3);