How to use the Glide image loading library in android

Glide is one of most used image loading library in the world for the android applications. This library provides the number of features. It’s syntax and mechanism looks like Picasso image loading library. But this is the difference from the Picasso on basis of the way how it downloads images, caches images and loads them into memory.

So in this blog, we will see some basic introduction and use of this library in our android application for loading images.

Introduction

Glide is the image library which is used for the loading the image in android app. The size of Glide image library is around 476KB and there is 2879 method count. Glide is on

Glide is on jcenter.  And we can simply import this library in our android project.

How to use

This library’s syntax is all most same with the Picasso library for the load the image in the Imageview.

Picasso: 

Glide: 

.skipMemoryCache(true) : we called this method for skip the memory cache. This means that Glide will not put the image in the memory cache. It’s important to understand, that this only affects the memory cache! Glide will still utilize the disk cache to avoid another network request.

.diskCacheStrategy(DiskCacheStrategy.NONE)) : There are four types of the DiskCacheStrategy which can be used, 
ALL: with both {@link #SOURCE} and {@link #RESULT}. */
NONE: /** Saves no data to cache. */
SOURCE: /** Saves just the original data to cache. */
RESULT: /** Saves the media item after all transformations to cache. */

Thanks for reading this blog, if you have any questions or problems ask in the comment section.

Happy Coding. Stay Super.

 

 

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close