How To: Getting Started With Picasso

Picasso is a widely used open source image loading library from Square. It is well tested, provides a number of features and is fast and optimized.

Step 1:

To get started add Picasso to your project dependency. Add the following lines to build.gradle file. Please check the latest version here and make the necessary adjustments.

dependencies {
    // your app's other dependencies
    compile 'com.squareup.picasso:picasso:2.5.2'

Step 2:

Give internet permissions to your application if the image is on a remote location. Add the following lines to AndroidManifest.xml file.

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

Step 3:

Add the following lines to the layout.xml file.


Step 4:

Finally, add the following lines to the file

ImageView imageView = (ImageView) findViewById(;

Placeholder is the image that will be displayed while the requested image is being loaded and error is the image that will be displayed if an error occurs in getting the requested image resource. Both placeholder and error are optional and can be excluded.

Step 5:

That is all, now build and run the application. The image will be downloaded, cached, displayed, and cleared from memory when your view goes off-screen.

If there are any questions let me know in the comments below. Check out the HowTo for Glide and Fresco as well.

Show Comments