Preface: Read a lot of wonderful articles, the author writes very well, but always feel that the text description is not a picture or diagram of the intuitive, because the picture can be abstracted into concrete. Language is regional, and pictures are universal, even if the language is not through, but can be understood through the picture. So want to do a series of simple blog, the content is a picture with some necessary instructions, so you can quickly grasp the focus, and do not need to do too much reading, you can understand the framework of things. Some of the pictures involved may come from the official website, some from the famous bloggers, or their own drawings, will be one by one instructions.
Cut to the chase, first of all,:
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. The image cache is divided into two parts: Memory cache and Disk cache.
2. When the picture is displayed, it is read from the memory cache first, and if it is found in the memory cache, the picture is displayed directly.
3. If the memory cache is not present, the disk cache is looked up, if found, it is encoded as Bitmap, then the picture is preprocessed, cached to memory, and the picture is finally displayed.
4. If neither the memory cache nor the disk cache are found, download the image, cache it to disk after downloading, then encode it as Bitmap, pre-preprocess the picture, cache it to memory, and then display the picture.
The Android picture cache frame has many, the principle all is similar, basically all is above logic, everybody may extrapolate, or writes own picture cache frame according to the above process.
Picture will talk series of Android picture cache frame