Hi,
Am 14.07.14 12:06, schrieb Ivan Kiliian:
> Cache cache = AppController.getInstance().getRequestQueue().getCache();
> Entry entry = cache.get(url);
> if(entry != null){
> //parse json from entry.data
> }else{
> //new JSONObjectRequest and parse response
> }
The JSONObjectRequest handles the caching stuff. You don't need to call
cache.get(url)
For an example see
http://www.androidhive.info/2014/05/android-working-with-volley-library-1/
step 4
> But what should I do if new video is uploaded to the channel? (video are
> not added as new listview item)
> - don't use cache
> - use cache.remove(url) when app is starting
> - use cache.invalidate(url, true/false) (how to use?)
> - something other
You have to call the JSONObjectRequest again. If the content has changed
the JSONObjectRequest downloads it. If it hasn't changed you get the
cached content.
Ralph