Enhance Your Application Using Picasso

A fluent image downloading and caching library for Android.

Square Engineering
May 14, 2013 · 2 min read

Written by D. Koutsogiorgas and Jake Wharton.

Heads up, we’ve moved! If you’d like to continue keeping up with the latest technical content from Square please visit us at our new home https://developer.squareup.com/blog

Today, we would like to introduce and open source Picasso, our solution for image downloading and caching on Android.

Picasso aims to be fast and simple to use — often requiring only one line of code.

Picasso.with(context).load("http://example.com/logo.png").into(imageView);

And that’s it! You can use this for downloading a single image or inside of an adapter’s getView method to download many. Picasso automatically handles caching, recycling, and displaying the final bitmap into the target view.

Picasso also allows you to transform images.

Picasso.with(context)
.load("http://example.com/logo.png")
.resize(100, 100)
.centerCrop()
.into(imageView);

The transformation will occur in the same background thread used to decode the original source bitmap and the final result will be stored into memory. This means you can store different transformations of the same source bitmap for future use.

Picasso automatically utilizes a memory and disk cache (provided by the HTTP client) to speed up bitmap loading. For development you can enable the display of a colored marker which indicates the image source.

For the latest release of Square Register and future releases of Square Wallet we really wanted to improve image downloading. Picasso is the result of lessons learned from our previous framework as well as various third-party libraries.

More information and downloads are available on the Picasso website.

This post is part of Square’s “Seven Days of Open Source” series.


Square Corner Blog

Buying and selling sound like simple things - and they…

Square Engineering

Written by

The official account for @Square Engineering.

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Square Engineering

Written by

The official account for @Square Engineering.

Square Corner Blog

Buying and selling sound like simple things - and they should be. Somewhere along the way, they got complicated. At Square, we're working hard to make commerce easy for everyone.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store