Original link: Click to view

About the Glide

Glide is a fast and efficient Android image loading library that focuses on smooth scrolling. Glide provides an easy-to-use API, a high-performance, scalable decode pipeline, and automated resource pooling technology.

Glide supports pulling, decoding, and displaying video snapshots, pictures, and GIF animations. Glide’s Api is so flexible that developers can plug in and replace it with any network stack they like. Glide by default uses a customized HttpurlConnection-based stack, but it also provides a tool library for quick integration with Google Volley and Square OkHttp.

Although Glide’s primary goal is to make scrolling through any kind of list of images as fast and smooth as possible, Glide can actually do almost anything you need to pull/zoom/display remote images.

API

Glide uses a concise streaming syntax API, which is a great design because it allows you to do what you need in most cases in one line of code:

Glide.with(fragment)
    .load(url)
    .into(imageView);
Copy the code

performance

Glide takes into account two key aspects of Android image loading performance:

  • Picture decoding speed
  • Resource pressure from decoding images

In order for users to have a good App experience, images should not only load quickly, but also not flicker and shake due to excessive main thread I/O or frequent garbage collection.

Glide uses a number of steps to ensure that loading images on Android is as fast and smooth as possible:

  • Automatic and intelligent underground sampling (downsampling) and caching (caching) to minimize storage overhead and decoding times;
  • Aggressive resource reuse, such as byte arrays and bitmaps, to minimize the impact of expensive garbage collection and heap fragmentation;
  • Deep lifecycle integration to ensure that only active Fragment and Activity requests are processed first, and to help applications free resources if necessary to avoid being killed in the background.

Begin to use

Please visit the Download and Setup page to learn how to integrate Glide into your application. You can then learn the basics from the getting Started page. For more help and examples, read on for the rest of the documentation, or take a look at sample applications.

Configuration requirements

Glide V4 supports Android Ice Cream Sandwich (API Level 14) at least.