I'm building a small app that will mostly be a directory of certain businesses. Everything is obtained through a REST service. I am having some issues dealing with the images while browsing the list of businesses.
The images that compose each list item are a background (functions as the 'banner' for the business) and up to 5 small icons representing the most important services that business provides.
I started using Picasso to asynchronously load these images with the hope that I could avoid creating any caching of my own. However, I've encountered a couple issues:
A) The biggest one is that on a lower end phone (LG Optimus V running Android 2.2), the background/banner, ALWAYS fails to load. I am using the error() option of Picasso to load a placeholder drawable when an background fails to load, but every single one fails to load and I can't figure out why. Things I have noticed about this:
- The small icons load just fine
- The onImageLoadFailed callback from Picasso doesn't actually trigger. But the placeholder I specify with error() does load.
- Memory doesn't seem to be the problem, as I am perfectly able to load these banners (same asset size) if they are local instead of remote.
- This issue doesn't happen in a Droid X running 2.3 and a couple of higher end devices.
B) On all devices, neither the services icons nor the banners ever seem to cache to disk (Picasso debug mode indicates they always load first from the remote source, and from then on from memory) even though Picasso is supposed to do this automatically. Not sure if I am missing some setting or something.
Actually, the service icons would be best if I could prefetch them at the start of the app because they repeat a lot between list (business) items. They can't be local assets because the list of possible services can grow at any point and as such more icons will come about regularly. But it would be great if at the start of the activity I could query for my list of services (already have a REST point for that) and prefetch all the icons and cache them. Is there an 'easy' way to do this?
Thank you for any guidance on these issue.