I am trying the parse the following JSON in android - http://cj1m.1.ai/test.json
At the moment, when running this code, my app crashes:
public String getJSON() throws IOException{
String url = "http://cj1m.1.ai/test.json";
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(is,"utf-8"),8);
String jsonText = reader.readLine();
return jsonText;
}
What am I doing wrong, and how can I fix this?