Image loading library for Android apps.
Almost every app needs some kind of image downloading from the server.
Here are the three most popular image loading library which you can use in your project I will give some basics to choose one of them.
Glide is a fast and efficient open-source media management and image loading framework for Android that wraps media decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.
Glide supports fetching, decoding, and displaying video stills, images, and animated GIFs. Glide includes a flexible API that allows developers to plug into almost any network stack. By default, Glide uses a custom
HttpUrlConnection based stack, but also includes utility libraries plug into Google's Volley project or Square's OkHttp library instead.
Glide’s primary focus is on making scrolling any kind of a list of images as smooth and fast as possible, but Glide is also effective for almost any case where you need to fetch, resize, and display a remote image.
UIL (Universal Image Library)
UIL aims to provide a powerful, flexible and highly customizable instrument for image loading, caching and displaying. It provides a lot of configuration options and good control over the image loading and caching process.
Customization on almost everything.
Different image format URLs support.
Listener for the loading process with the possibility to get data about downloading progress.
Development support has been stoped since 2015.
Android Picasso is an image loading/processing library developed and maintained by Square Inc. It’s immensely popular since it often requires just one line of code and has a similar style of coding for each of its features.
Android Picasso comes with its own set of features such as:
- Resizing and Scaling
- Center Cropping
- Rotation and Transformation
- Setting the Placeholder and Error images
- Disk and Memory Caching
- Priority Requests
- Support for Request cancellation and parallel downloading
Key Notes for Glide and Picasso:
- Picasso and glide are 90% the same.
- Picasso uses context in with parameter but glide uses context as well as Activity/Fragments context which is very useful for sync with the lifecycle of components.
- The image quality of Picasso is good because of default bitmap format ARGB_8888 while Glide uses RGB_565 so comparatively low quality.
- Glide takes half of the memory as taken by Piccasso that's why image quality is a bit low while comparing to Piccasso.
- Picasso downloads full image and lets the CPU fit in an image view. but on the other hand glide download only sized image accordingly image view size.
- Anyway you can change the behavior of Picasso to do the same with
- But the problem is you need to manually calculate the ImageView’s size. Or if your ImageView has the exact size (not set to wrap_content), you can simply do like this.
- The default disk caching concepts of Picasso and Glide are quite different. From the experiment, the same Full HD image is loaded into ImageView with Picasso and Glide. When I checked the cache folder, it appears that Glide cached the ImageView-size (768x432 pixels) while Picasso cached the full-size one (1920x1080 pixels).
- An ability to load GIF Animation to a simple ImageView might be the most interesting feature of Glide. And yes, you can’t do that with Picasso.
- And since Glide is designed to work perfectly with Activity/Fragment’s lifecycle so the animation would be automatically paused and resumed along with Activity/Fragment’s state.
- The way Glide caches are still the same, resized first and then cached.
- Another feature that might be useful of Glide is you can configure the way image appears with an Animator (R.animator) while Picasso could do only one animation, fading in.
Neither Glide nor Picasso is perfect. You can use any of this library based on your application requirement. If you want the smaller app and you require very fewer features in the image loading than Picasso is best. But If you want more customization, animated GIF support, and very better memory management, you should use Glide as your image loader library.
In my opinion, Glide is the winner over here as it handles memory very well and prevents my app from OutOfMemoryError. Also, loads image much faster than Picasso. And yes, the support for animated GIFs is almost killed.
Introduction to Glide, Image Loader Library for Android, recommended by Google
In the passed Google Developer Summit Thailand, Google introduced us an Image Loader Library for Android developed by…