SOURCE Address: Click to open the link
The extensive use of android-universal-image-loader, we need to study him carefully, for our use, and progress have a lot of help,
From the frame composition, the project is divided into five parts.
1, displayer, display picture module. This part of the main role of displaying pictures, including several ways to display pictures, such as cutting edge display pictures.
By calling display (Bitmap Bitmap, Imageaware imageaware, Loadedfrom loadedfrom);
2, Assist Classes, this part is the helper class module . The main ones are enumeration classes, the queue that holds the task, and some helper classes
3, Imageloader, the main function of this part is to initialize some settings and interface to the user,
4, Displaytask, display the Task module . This class is a thread that is responsible for invoking the display method of Displayer to show the picture
5,loadtask, load the task module . The class is also a thread that is responsible for initiating loading and downloading picture threads.
6, Downloader, download the task module , the module is responsible for downloading, network connection through two ways, one is httpclient, one is HttpURLConnection, the former is a class of Apache encapsulation, Information such as cookies is saved, supporting background services that need to verify user login information, which is not supported, and includes processing when the network is slow and when the network connection fails.
7, cache, caching module, the module includes the local cache and memory cache, the cache size settings in the Imageloader initialization method.
8, Decode, decoding module. This module is the module that decodes the picture, obtains the bitmap according to the InputStream.
So many of the above modules are interface-oriented programming, defining interfaces first, and then adding implementation classes for different business requirements.