Search in sources :

Example 6 with DiskBasedCache

use of com.android.volley.toolbox.DiskBasedCache in project DesignLibrary by StylingAndroid.

the class VolleySingleton method getRequestQueue.

public RequestQueue getRequestQueue() {
    if (requestQueue == null) {
        Cache cache = new DiskBasedCache(context.getCacheDir(), CACHE_SIZE);
        Network network = new BasicNetwork(new HurlStack());
        requestQueue = new RequestQueue(cache, network);
        requestQueue.start();
    }
    return requestQueue;
}
Also used : BasicNetwork(com.android.volley.toolbox.BasicNetwork) HurlStack(com.android.volley.toolbox.HurlStack) RequestQueue(com.android.volley.RequestQueue) Network(com.android.volley.Network) BasicNetwork(com.android.volley.toolbox.BasicNetwork) DiskBasedCache(com.android.volley.toolbox.DiskBasedCache) Cache(com.android.volley.Cache) DiskBasedCache(com.android.volley.toolbox.DiskBasedCache)

Aggregations

DiskBasedCache (com.android.volley.toolbox.DiskBasedCache)6 RequestQueue (com.android.volley.RequestQueue)5 BasicNetwork (com.android.volley.toolbox.BasicNetwork)4 HurlStack (com.android.volley.toolbox.HurlStack)4 Cache (com.android.volley.Cache)3 Network (com.android.volley.Network)3 File (java.io.File)3 Response (com.android.volley.Response)1 VolleyError (com.android.volley.VolleyError)1 StringRequest (com.android.volley.toolbox.StringRequest)1 OkNetwork (im.amomo.volley.OkNetwork)1