public class VolleyUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
VolleyUtil.BitmapLruCache
The
VolleyUtil.BitmapLruCache is an implementation of ImageLoader.ImageCache
that stores bitmaps (in memory) to a maximum number of bytes. |
static class |
VolleyUtil.CacheEntryRequest<T>
The
VolleyUtil.CacheEntryRequest class is an extension of Volley's
Request class and is used to return a response that contains both
the information returned from the server and the cache entry associated
with the returned response.The cache entry is used by Volley to determine if a previously retrieved response (cached on the disk) can be returned immediately without contacting the server. |
static class |
VolleyUtil.CacheEntryRequestParams |
static class |
VolleyUtil.CacheEntryResponse<T>
The
VolleyUtil.CacheEntryResponse is the object returned from a
VolleyUtil.CacheEntryRequest .The VolleyUtil.CacheEntryResponse includes both the information returned
from the server and the cache entry associated with the returned
response.Note: The returned VolleyUtil.CacheEntryResponse is not guaranteed to have a
non-null cache entry. |
static class |
VolleyUtil.RequestParams
The
VolleyUtil.RequestParams is a class used to pass in to Volley requests
that is used set provided values against the request. |
static class |
VolleyUtil.SimpleImageListener
The
VolleyUtil.SimpleImageListener is an implementation of
ImageLoader.ImageListener with all methods implemented to default. |
static class |
VolleyUtil.StringRequest
The
VolleyUtil.StringRequest class is an extension of Volley's
Request class and is used to automatically unbox returned string
responses from the server.The VolleyUtil.StringRequest class extends from VolleyUtil.CacheEntryRequest so
that the cache entry associated with the response can be retrieved with
the returned string. |
Constructor and Description |
---|
VolleyUtil() |
Modifier and Type | Method and Description |
---|---|
static VolleyUtil.CacheEntryResponse<java.lang.String> |
executeStringRequest(VolleyUtil.CacheEntryRequestParams params)
Execute a server request that returns a string response using the given
request parameters.
|
static long |
getCacheEntryExpiry(VolleyUtil.CacheEntryRequest<?> request)
Get the expiry timestamp (based on the time to live) at which point the
response cached (on disk) will have expired.
Return -1 if the request has no entry cached. Note: The returned value can be compared to the current time System.#currentTimeMillis() to see if the cached content requires to be
refreshed from the server. |
static java.util.Map<java.lang.String,java.lang.String> |
getNetworkResponseHeaders(long cacheDurationMillis)
Return a set of headers that can be attached to a
NetworkResponse
that denotes the response should be cached for the given length of time. |
public static VolleyUtil.CacheEntryResponse<java.lang.String> executeStringRequest(VolleyUtil.CacheEntryRequestParams params) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public static long getCacheEntryExpiry(VolleyUtil.CacheEntryRequest<?> request)
System.#currentTimeMillis()
to see if the cached content requires to be
refreshed from the server.public static java.util.Map<java.lang.String,java.lang.String> getNetworkResponseHeaders(long cacheDurationMillis)
NetworkResponse
that denotes the response should be cached for the given length of time.cacheDurationMillis
- The duration (in milliseconds) that the
response should be cached for.