I use an Asynchronous Http Client for Android for loading my JSON data.(https://github.com/h-r/android-async-http-with-caching)
It works perfect, but i want to cache json files if user has no connection.
I know how to check if user had internet connection etc, but i use a version of Asynchronous Http Client of loopj who has caching enabled for httpresponse's
The problem is that my code give's just a error..
WhtsnxtBase.get(dateje, null, new JsonHttpResponseHandler() {//get url with date of json file
@Override
public void onSuccess(JSONObject timeline) {
// code removed isn't relevant for this question
}
@Override
public void onFailure(Throwable e) {Log.e("MyActivity", "OnFailure!", e);}
@Override
public void onFailure(Throwable e, String response) {Log.e("MyActivity", "OnFailure!", e);}
@Override
public void onFailure(Throwable e, JSONArray errorResponse) {Log.e("MyActivity", "OnFailure!", e);}
});
This is the url (to see wat kind of date it is etc..http://calvijn.tk/mobiel/2013-07-19)
The cache don't work do anybody know how to fix it, or how to use the cached library properly?
If it isnt't possible this way, does anybody know a good opensource cache manager or something to cache the JSON files the right way.