Professional Documents
Culture Documents
Volley: Easy, Fast Networking For Android
Volley: Easy, Fast Networking For Android
TOPICS
What is Volley?
About Volley
Implementation
Why Volley?
Exception !
Biblography
Powerful customization
About Volley
On Front - End
Great for RPC-style network operations that populate UI
Fine for background RPCs
On Back End
Parallel hits in one go
Response can be format as Dev. Wants
Exceptions Handler is provided
Volleys Architecture
It works on three levels :1st It works on the Main thread of the application
where its start to hit for the request made by the
Dev. & Dev. only handles the response
2nd It works on Cache thread , in this thread volley
checks whether the request is repeated or not if it is
repeated it takes the response from the cache where
everything is saved if not it will pass the request to
network thread.
3rd it works on Network thread, where it makes the
request and get response from the server & forward
the response to the app.
Implementation
It contains only to classes to operate over the network and to get the response
1st is Request class :- where all the request are made w.r.t to the
context of that class like
Volley.newRequestQueue(context);
where newRequestQueue is the method to add as many
request as you want top process parallel
2nd is the Response class :- where the response of the request is taken.
There are three types of responses you can get :1.
String Request where the request made is for getting the string
2.
Json Request where the request is made to get the json object or array
3.
Response<T> , this is the custom request where the developer can request in the form he/she wants to receive
Like :-
To Avoid Asyntask
basically a handler which is used to work
background thread or services.
The main problem with the Asyntask was
works in serialization method like FIFO. So,
processing time increases.
on
that it
It is Faster
As per the test done by the
google+ Volley library works faster
around 10x times when using
RESTful APIs
i.e.,
Representational State Transfer
It Caches Everything
It Localy make objects for the
request already got hit
Exception
Biblography
Google Images
Various Blogs
Thank You
BY Harshdeep Singh