String JSON = \"http://www.json-generator.com/j/cglqaRcMSW?indent=4\";
JSONObject jsonObject = new JSONObject(JSON);
JSONObject getSth = jsonObject.getJSONObject(\"
I had same issue. My Json response from the server was having [, and, ]:
[{"DATE_HIRED":852344800000,"FRNG_SUB_ACCT":0,"MOVING_EXP":0,"CURRENCY_CODE":"CAD ","PIN":" ","EST_REMUN":0,"HM_DIST_CO":1,"SICK_PAY":0,"STAND_AMT":0,"BSI_GROUP":" ","LAST_DED_SEQ":36}]
http://jsonlint.com/ says valid json. you can copy and verify it.
I have fixed with below code as temporary solution:
BufferedReader br = new BufferedReader(new InputStreamReader((response.getEntity().getContent())));
String result ="";
String output = null;
while ((result = br.readLine()) != null) {
output = result.replace("[", "").replace("]", "");
JSONObject jsonObject = new JSONObject(output);
JSONArray jsonArray = new JSONArray(output);
.....
}