Android Bitmap in-depth introduction (III)---Open source loading framework Brief

Source: Internet
Author: User

Pop frame

Currently using a very broad framework technology mainly has Android Universal image Loader,picasso, glide and fresco, the first appearance should be considered UIL (Universal Image Loader), Remember when you first loaded the frame with a picture, the main thing is to use Uil,uil feature rich. Picasso is square out, glide and Picasso similar, Google recommended Glide,fresco is a Facebook launch of a picture loading library, this library is worth a look, there are many very unique places, very powerful open source library. In addition volley is also a good picture loading frame, very light weight.

Basic framework

These frameworks can be divided into several parts: the execution engine (engine, or dispatch center), the Request generation section, the cache section, the Image Processing section, and the Picture Display section. This basically covers the entire process of getting pictures from the Web or locally and showing them to the user.

Comparison

About the comparison between them, can refer to Trinea's article Android three big picture cache principle, characteristic contrast, below briefly introduce their pros and cons:

    • Android-universal-image-loader: Is the earliest picture loading library, the application is also the most extensive, the function is very rich. It supports download snooping, provides a number of caching algorithms, and can pause loading during scrolling
    • Picasso:
      Square launches the Open Source Library, which supports image cache monitoring, loading images by priority
    • Glide
      Google recommended images load open Source Library, support GIF (using third-party package), WEBP, thumbnail, video. Provides an interface for users to use the network protocol stack they need. On the other hand, the glide can be aligned with the activity/fragment cycle and provide trimmemory for use.
    • Fresco
      Facebook's images are loaded with open source libraries, which are very powerful. There are mainly memory management, progressive loading, WEBP format, gif,pipeline loading.
Related Source Analysis Articles

Network above about these images open source framework of the source analysis is quite a lot of, but these source analysis is generally only for reference assistance, if you need to know the content of these sources, it is best to go to see the source code himself.

Android-universal-image-loader:android Universal Image Loader Source Analysis

picasso:http://blog.happyhls.me/category/android/picasso/
http://skykai521.github.io/2016/02/25/Picasso%E6%BA%90%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90/

Glide:android Glide Source Code Analysis

Fresco:fresco-source-analysis

Related Features GIF

GIF is currently supported by both glide and fresco. The processing of the GIF,FRESCO is consistent with our understanding of GIF, decoding all the frames of the GIF first, and then using the animation to place it one frame at a frame. This is done by changing the drawing of the drawable, drawing the corresponding frame each time it is drawn:

  PrivateBooleanRenderframe(Canvas canvas,intFramenumber,intFramemonotonicnumber) {closeablereference<bitmap> bitmapreference = manimateddrawablebackend.getbitmapfor Frame (Framenumber);if(Bitmapreference! =NULL) {Canvas.drawbitmap (bitmapreference.Get(),0F0F, Mpaint);if(Mlastdrawnframe! =NULL) {mlastdrawnframe.close (); }if(misrunning && framemonotonicnumber > Mlastdrawnframemonotonicnumber) {intDroppedframes = Framemonotonicnumber-mlastdrawnframemonotonicnumber-1; Manimateddrawablediagnostics.incrementdrawnframes (1); Manimateddrawablediagnostics.incrementdroppedframes (Droppedframes);if(Droppedframes >0) {FLOG.V (TAG,"(%s) Dropped%d frames", Mlogid, Droppedframes);      }} mlastdrawnframe = Bitmapreference;      Mlastdrawnframenumber = Framenumber;      Mlastdrawnframemonotonicnumber = Framemonotonicnumber; FLOG.V (TAG,"(%s) Drew frame%d", Mlogid, Framenumber);return true; }return false; }
Webp

WEBP is a new form of image introduced by Google, he can effectively compress the image without affecting the compatibility and actual sharpness of the picture, improve the speed of the image download, the same quality of its compressed volume is probably 40% jpg. But the encoding time is about 8 times times longer than the JPG. At present, Facebook and QQ space have used WEBP pictures.

Progressive loading

This is a feature provided by Fresco and currently only supports JPG network images. Can be in the film, let the picture gradually from the blur to clear gradually show. JPEG format pictures in two ways, one is directly encoded, and the other is progressive encoding, can be used to fresco progressive loading is to pass the progressive encoding of the JPEG image. Compression standards.

Android Bitmap in-depth introduction (III)---Open source loading framework Brief

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.