Search in sources :

Example 1 with BasicNetwork

use of com.android.volley.toolbox.BasicNetwork in project fresco by facebook.

the class SampleVolleyFactory method getRequestQueue.

public static RequestQueue getRequestQueue(Context context) {
    if (sRequestQueue == null) {
        File cacheDir = new File(context.getCacheDir(), VOLLEY_CACHE_DIR);
        sRequestQueue = new RequestQueue(new DiskBasedCache(cacheDir, ConfigConstants.MAX_DISK_CACHE_SIZE), new BasicNetwork(new HurlStack()));
        sRequestQueue.start();
    }
    return sRequestQueue;
}
Also used : BasicNetwork(com.android.volley.toolbox.BasicNetwork) HurlStack(com.android.volley.toolbox.HurlStack) RequestQueue(com.android.volley.RequestQueue) DiskBasedCache(com.android.volley.toolbox.DiskBasedCache) File(java.io.File)

Example 2 with BasicNetwork

use of com.android.volley.toolbox.BasicNetwork 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

RequestQueue (com.android.volley.RequestQueue)2 BasicNetwork (com.android.volley.toolbox.BasicNetwork)2 DiskBasedCache (com.android.volley.toolbox.DiskBasedCache)2 HurlStack (com.android.volley.toolbox.HurlStack)2 Cache (com.android.volley.Cache)1 Network (com.android.volley.Network)1 File (java.io.File)1