I have script return JSON like this
{"a":"something","b":"something"}
{"a":"something1","b":"something1"}
It's NDJSON response! Now i am trying to retrieve it from android but i get null on jsonResult. This is the code I use after fetching:
JSONObject jsonResponse = new JSONObject(jsonResult);
JSONArray jsonMainNode = new JSONArray(jsonResponse);
I get null pointer exception on first line because jsonResult is null. What is wrong?
This is how i fetch:
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
HttpResponse response = httpclient.execute(httpget);
jsonResult = inputStreamToString(
response.getEntity().getContent()).toString();