title: JakeWharton's DiskLruCache - How to Implement with Volley?
body: <p>This is in connection with <a href="https://stackoverflow.com/questions/21848749/volley-image-caching">this</a> question regarding Volley Image caching. So, now I want to implement DiskLruCache, but I am not sure on how to do this.</p>
  
  <p>I downloaded the Jar file from <a href="https://github.com/JakeWharton/DiskLruCache" rel="nofollow noreferrer">github</a> and added it to my project.</p>
  
  <p>What should I do next? How can I change the existing code of Volley and integrate DiskLruCache?</p>
  
  <p>Existing code:</p>
  
  <p>Initialising Volley:</p>
  
  <pre><code>queue = Volley.newRequestQueue(getActivity());
  imageLoader = new ImageLoader(queue, new ImageLoader.ImageCache() {
      private final LruCache&lt;String, Bitmap&gt; mCache = new LruCache&lt;String, Bitmap&gt;(
              10);
  
      public void putBitmap(String url, Bitmap bitmap) {
          mCache.put(url, bitmap);
      }
  
      public Bitmap getBitmap(String url) {
          return mCache.get(url);
      }
  });
  </code></pre>
  
  <p>Getting response from server and parsing:</p>
  
  <pre><code>jsArrayRequest = new JsonArrayRequest(url,
          new Response.Listener&lt;JSONArray&gt;() {
              @Override
              public void onResponse(JSONArray response) {
                  if (Const.DEBUGGING) {
                      Log.d(Const.DEBUG,
                              "Response =&gt; " + response.toString());
                      Log.d(Const.DEBUG, "Length = " + response.length());
                  }
                  parseResponse(response, url);
  
                  setRetrivalSuccess();
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  if (Const.DEBUGGING) {
                      Log.d(Const.DEBUG, "Volley Error");
                      Log.d(Const.DEBUG, "Error = " + error.toString());
                  }
  
                  ((MainFragmentActivity) getActivity())
                          .setSupportProgressBarIndeterminateVisibility(false);
  
              }
          });
  queue.add(jsArrayRequest);
  </code></pre>
  
  <p>I have seen few examples on SO, but I couldn't understand how to link Volley with DiskLruCache. </p>