user3376321 user3376321 - 1 year ago 51
Android Question

Why use Android Picasso library to download images?

Why should I download the images via the Picasso library instead of just using this code:

private Bitmap DownloadImage(String URL)
Bitmap bitmap = null;
InputStream in = null;

in = OpenHttpGETConnection(URL);
bitmap = BitmapFactory.decodeStream(in); in.close();
catch (Exception e)
Log.d("DownloadImage", e.getLocalizedMessage());

return bitmap;

Another question:

Does Picasso download the image in the UI or by background thread?

Answer Source

Just for the record for anyone new to Android or perhaps moving to Android from iOS ..........

Until something drastically changes, you absolutely have to use Picasso. Not a joke.

Honestly, it's that simple. The advantages are unbelievable.

It's this easy to use:


You very simply:

must do caching, and threading, with image handling on Android.

It's that simple. Unless you want to write that from scratch, you simply must use Picasso.

Note that ParseImageFile essentially doesn't work - it is utterly useless about caching and so on. There are admirable alternatives to Picasso (such as Universal Image Loader, check it out), but none work as well as Picasso, for now 2014.

Note if you move to super-advanced-stuffs... The only thing better than Picasso, is to make the move to Volley. but that is a huge leap.

Note that ListView scrolling on android is much, much more problematic than table handling scrolling on iOS. You could say, Android + Picasso is MORE LIKE the situation on iOS, where all the work is already done for scrolling large table views with images.

For today, Picasso is - simply - a central part of any Android app whatsoever. Thank goodness, it is one line of code - no setup, nothing.

Again, the only thing "better than" Picasso is if you move to Volley.

BTW here's an excellent long article on Volley v. Picasso, if you need that...