Volley Source Code Analysis

Source: Internet
Author: User

Volley source code is divided into two parts
1. Core class library (mainly interface-based) 2. Each interface implements the class, the tool class

The 2nd part is to realize the interface, provide the main tool, does not affect the data flow, so we can temporarily ignore.
Look at the 1th part, a lot of error, log temporarily do not look, compared to the periphery. The rest of the class, put a uml as follows

Each interface & class explanation
Network: Send a request and receive an answer via the Web (httpurlconnection or httpclient)
Cache: Provides caching capabilities, set and get caches primarily for get, put two methods
Networkdispatcher: Gets the request in the network side blocking queue, obtains the result through the net execution request, sets the cache, returns the result by responsedelivery
Cachedispatcher: Gets the request in the cache side blocking queue, gets the cache of the corresponding request from the cache, does not exist or expires, sends the request to the network side blocking queue, and the presence returns the result by responsedelivery
Responsedelivery: Defines three kinds of return result interfaces

The process is divided into 3 main parts
1. Initialization process
2. Request flow through the network
3. Through the cache request process

Volley Source Code Analysis

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.