Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
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.
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.
dependencies { compile 'com.github.bumptech.glide:glide:3.7.0' } 123 dependencies { compile 'com.github.bumptech.glide:glide:3.7.0'}
This library’s syntax is all most same with the Picasso library for the load the image in the Imageview.
Picasso:
Picasso.with(view.getContext()) .load(imageUrl) .placeholder(R.drawable.placeholder) .into(view, utils.getCallBack(view)); 1234 Picasso.with(view.getContext()) .load(imageUrl) .placeholder(R.drawable.placeholder) .into(view, utils.getCallBack(view));
Glide:
Glide.with(view.getContext()) .load(imageUrl).placeholder(R.drawable.placeholder) .diskCacheStrategy(DiskCacheStrategy.NONE) .skipMemoryCache(true) .dontAnimate() .into(view); 123456 Glide.with(view.getContext()) .load(imageUrl).placeholder(R.drawable.placeholder) .diskCacheStrategy(DiskCacheStrategy.NONE) .skipMemoryCache(true) .dontAnimate() .into(view);
.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.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Hussein Zawia
Co-founder, 24Dokan
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.