I have a PHP JSON that sends me JSONArray.
public JSONArray lastTweet()throws ClientProtocolException,IOException,JSONException{
StringBuilder url = new StringBuilder(URL);
HttpGet get = new HttpGet(url.toString());
HttpResponse r = client.execute(get);
int status = r.getStatusLine().getStatusCode();
if(status == 200){
HttpEntity e = r.getEntity();
String data = EntityUtils.toString(e);
JSONArray timeline = new JSONArray(data);
return timeline;
}
return null;
}
I can get Object and values from this JSONArray (timeline), but it work only then application have internet conection. I want to save this JSON in my internal storage like a json file and after work with this file in offline mod. How i can do this?