Picasso image loading on Android for Australian developers
Loading a photo into an ImageView sounds trivial until the app is running on a train between Sydney and Wollongong, the signal drops, and the user is left staring at an empty grey box. On a cellular connection from Telstra, Optus or Vodafone, every uncached request competes for a data-limited mobile plan, and a full-resolution photo can quietly consume megabytes the customer never intended to spend. Good image loading is really about managing that cost and the waiting.
Picasso is the library that does the heavy lifting. It fetches an image over HTTP, decodes and downsamples it on a background thread, keeps a copy in memory so the next scroll is instant, and delivers the finished bitmap to the main thread without blocking the interface. Underneath the friendly builder API sits OkHttp, Square's HTTP client, so you inherit connection pooling, HTTPS support and sensible response caching without writing any of it yourself.
What Picasso does under the hood
Every call to Picasso.get().load(...) follows the same path. Picasso checks its memory cache for a bitmap matching the URL and the requested size. On a miss, the request goes to OkHttp, which checks the disk cache and then the network. The returned bytes are decoded and downsampled to the dimensions of the target ImageView, then handed back on the main thread, where Android allows drawing to happen.
Two caches keep this cheap in practice. The memory cache holds recently decoded bitmaps in an LruCache sized against the app's heap. The disk cache stores raw responses inside the app's cache directory, keyed by URL, and honours the Cache-Control headers that most CDNs send. A photo published with a long max-age can come back from disk even after the app has been closed, which helps when coverage is patchy around the outskirts of Adelaide or on the Perth trains.
That efficiency comes with a trade-off. Picasso is a process-wide singleton with no built-in awareness of the Android lifecycle, so a request started in a paused activity can still deliver a result later. Most apps handle this by tagging views and cancelling requests in onDestroy, in onPause, or when a list row is recycled.
Adding Picasso to your Gradle project
Picasso ships through Maven Central, so the dependency is a single line in your app-level build.gradle file: implementation "com.squareup.picasso:picasso:2.71828". The library still supports old Android releases, though any app you publish on Google Play will be targeting a recent API level regardless.
The manifest needs the INTERNET permission, which is the only requirement Picasso imposes. Many Australian apps already declare it for analytics, maps or crash reporting, so adding Picasso rarely changes anything there. It is worth checking that your privacy policy mentions outbound image requests if you display customer photos, since the Privacy Act 1988 and the Australian Privacy Principles shape what you can collect and how long you keep it.
The dependency is the easy part. If Gradle complains about duplicate classes after an upgrade, clean the project and confirm you have not mixed an old support-library version into the build. For a wider walkthrough of project structure, emulator handling and the Android SDK basics, the Android Open Tutorials notes are a helpful companion while you set things up.
Loading images with readable builders
The everyday call reads like a sentence: Picasso.get().load(imageUrl).placeholder(R.drawable.placeholder).error(R.drawable.error).fit().centerCrop().into(imageView). Placeholder and error drawables are the difference between a polished app and one that flashes blank rectangles, and fit() asks Picasso to size the bitmap to the view rather than trusting the source dimensions.
load() accepts far more than web addresses. Pass a drawable resource ID, an asset path, a file:// URI for something you have written to local storage, or a content:// URI from MediaStore when the customer picks a photo from their gallery. Picasso resolves those last two through the content resolver, so there is no need to read the stream into a byte array yourself. For line-by-line examples of these builders, the Android Tutorial Point collection of Picasso snippets is handy the first time you wire a screen together.
In a RecyclerView, keep each request tied to its item view. Picasso stores the request tag on the ImageView, and cancelling it in onViewRecycled stops a fast scroll from filling recycled rows with the wrong pictures. If your rows use a fixed-height image, specify resize(width, height) so the decode downsamples the source instead of allocating a huge bitmap and shrinking it afterwards.
Caching, threading and list behaviour
Cache policy is where most of the tuning happens. A request can be forced to hit the network with .setNetworkPolicy(NetworkPolicy.NO_CACHE), or served from disk only with .setNetworkPolicy(NetworkPolicy.OFFLINE) when you know the customer is out of coverage. You can also build your own client with Picasso.Builder(this).downloader(new OkHttp3Downloader(client)) to attach a larger OkHttp disk cache, a logging interceptor or certificate pinning for the backend you talk to.
Threading is handled for you, with one important caveat: every request is asynchronous and delivers results on the main thread, so no background permission or coroutine scope is required. Custom work belongs in a callback. Implement Picasso.Callback and pass it to into(imageView, callback) if you need to know whether a load succeeded, and remember to clear any progress indicator in onFinish.
That combination of caching and cancel-on-recycle is what makes Picasso comfortable in a scroll-heavy screen. It is also the pattern local product teams appreciate: grocery and parcel-tracking apps built in Melbourne or Brisbane often show cached thumbnails first and fetch the full photo later, because a mobile data cap on a prepaid plan is a real barrier. A simple toggle for "download full images on Wi-Fi only" is easy to add and saves customers money.
Transformations, custom targets and troubleshooting
Transformations go beyond fit() and centerCrop(). You get centerInside(), rotate(), resize() and fill(), and you can subclass Transformation for anything else, returning a Bitmap from transform() and a key() string that differs whenever the output changes. The key matters, because Picasso caches transformed results under it; reuse the same key for different parameters and you will serve the wrong crop.
For preloading or off-screen work, implement PicassoTarget and pass your target to into(target). This is the hook to warm the cache for the next screen, which is handy for a booking flow where a customer taps through from a list to a detail page. Callbacks hand you the loaded, downsampled bitmap when you need it for a share sheet or an upload.
When images simply do not appear, work through the usual suspects. Plain HTTP addresses are blocked by default on modern Android, so move to HTTPS and declare a network security configuration if you must. A 404 produces your error drawable rather than an exception, so check the response code as well as the logcat output. On the emulator, remember that 10.0.2.2 points at the host machine rather than localhost. And if you need a different tool, Coil is a strong choice for Kotlin-first projects and Jetpack Compose, while Glide handles animated GIFs and a large module ecosystem with less ceremony.
Put it in a real app and measure
The fastest way to learn the library is to ship it into something small: an Australia Post parcel tracker, a recipe app from a Melbourne café, a gym log used at the gym after work. Add Picasso, wire up placeholders, run it on a real handset across a suburb in Perth, and watch the network panel in Android Studio. The memory profiler will show whether downsampling and cache sizing are doing their job.
Before you publish, check the details that Australian customers and regulators notice. Confirm that any cached photos of customers are handled consistently with your privacy obligations, keep a record of image licences and attribution for Creative Commons or stock photography, and be careful with performance claims under the Australian Consumer Law. If you sell subscriptions or downloads locally, remember that Google Play prices appear in Australian dollars and your business will be charging GST at 10 per cent on local services.
Start with the dependency, load one image properly, then measure. Once that first load behaves, the rest is configuration: placeholders, sizing, caching and cancellation.