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
Todo
2. Request flow through the network
Todo
3. Through the cache request process
Todo
Volley Source Code Analysis