Android image caching framework of image talking series,

Source: Internet
Author: User

Android image caching framework of image talking series,

I have read many wonderful articles, but I always think that text descriptions are not as intuitive as pictures or chart descriptions, because they can be abstracted as concrete. The language is regional, while the image is universal all over the world. Even if the language is not available, you can understand everything through the image. Therefore, if you want to create a series of simple blogs, the content is a picture with some necessary instructions, so that you can quickly grasp the key points and understand the framework without having to read too much. Some of the images involved in the article may come from official websites, from famous blogs, or from self-drawn ones.

 

Let's get started with the first round ,:

 

From: https://github.com/nostra13/Android-Universal-Image-Loader

This is the Image processing flowchart of the famous open-source library Android-Universal-Image-Loader.


Brief description:

1. Image cache is divided into two parts: memory cache and disk cache.

2. When the image is displayed, the image is read from the memory cache. If the image is found in the memory cache, the image is displayed directly.

3. If the memory cache does not exist, search in the disk cache. If it is found, encode it as Bitmap. Then, pre-process the image, cache it To the memory, and display the image.

4. if no image is found in both the memory cache and the disk cache, download the image, cache it to the disk, encode it as Bitmap, and pre-process the image, then cache the image to the memory and display the image.

 

There are many Android image cache frameworks and their principles are similar. They are basically the above logic. You can write your own image cache framework based on the above process.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.