Glide??

Glide is a fast and efficient image loading library for Android. It offers an easy to use API, a performant and extensible resource decoding pipeline and automatic resource pooling. It’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.

Does it support well?

Glide supports fetching, decoding, and displaying video stills, images. It includes a flexible api that allows developers to plug in to almost any network stack. By default Glide uses a custom HttpUrlConnection based stack, but also includes utility libraries plug in to Google’s Volley project or Square’s OkHttp library instead.

You may require to load GIFs at some point in your app, you can use Glide because it supports GIFs too which is one of the killer feature of this amazing library. Latest version of Glide (Glide v4) requires a minimum API level of 14 and requires you to compile against API 26. If you need to support older versions, consider staying on Glide v3, which works on API 10, but not actively maintained.

Can’t compromise with Performance?

For users to have a great experience with an app, images must not only appear quickly, but they must also do so without causing lots of jank and stuttering from main thread I/O or excessive garbage collections.

Glide takes into account two key aspects of image loading performance on Android:
– The speed at which images can be decoded.
– The amount of jank incurred while decoding images.

Glide takes a number of steps to ensure image loading is both as fast and as smooth as possible on Android:
– Smart and automatic downsampling and caching minimize storage overhead and decode times.
– Aggressive reuse of resources like byte arrays and Bitmaps minimizes expensive garbage collections and heap fragmentation.
– Deep lifecycle integration ensures that only requests for active Fragments and Activities are prioritized and that Applications release resources when necessary to avoid being killed when backgrounded.

While comparing the sizes of the .jar file with other libraries, Glide is larger than others in size but if it is big then definitely it offers more.

What it offers?

Better Disk caching:
Glide caches separate files for each size of ImageView and very much faster in loading cached images than other available libraries.

Less Memory Consumption:
Glide loads an image that is already resized as per the ImageView, that requires significantly less memory than loading the full image like Picasso. This helps to prevent your app from throwing popular OutOfMemoryError.

GIF Support:
With Glide, you can load GIF images too so if you want to load GIF’s in your application then Glide is the perfect for you.

Thumbnail Support:
You can load multiple images into the same view at the same time.

Variety of Transformation:
Glide, you can load images and apply different transformations easily. By default Glide support Center Crop and Fit Center. If you want custom transformation you can add it too but Wasabeef took it to the next level, just check it out.

How to use it?

You can download a jar from GitHub’s releases page.
Or use Gradle:
repositories {
mavenCentral()
maven { url ‘https://maven.google.com’ }
}
dependencies {
compile ‘com.github.bumptech.glide:glide:4.3.1’
annotationProcessor ‘com.github.bumptech.glide:compiler:4.3.1’
}
Or Maven:
<dependency>
<groupId>com.github.bumptech.glide</groupId>
<artifactId>glide</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>r7</version>
</dependency>
<dependency>
<groupId>com.github.bumptech.glide</groupId>
<artifactId>compiler</artifactId>
<version>4.3.1</version>
<optional>true</optional>
</dependency>
Syntax:
Basic syntax is :
Glide.with(context)
.load(url)
.centerCrop()
.placeholder(R.drawable.loading_spinner)
.crossFade()
.into(ImageView);

Why should we use it?

You can use any library based on your application requirement because neither Glide nor other image loading libraries are perfect. If you want it for smaller app and you require very few features in the image loading, than Picasso and other libraries are best. But If you want more customization, animated GIF support, and very better memory management, you should go with Glide as your image loader library.

Want to know more about it?

Please take a look on below links to explore Glide’s Power in detail.
– Glide 3.0: a media management library for Android
– Glide Wiki
– Android Picasso vs Glide
– Android: Image loading libraries Picasso vs Glide

Want to work with us? We're hiring!