i have a problem with jsonObject.
in android app i have:
try {
jObj = new JSONObject(json);
} catch (JSONException e) {
Log.e("JSON Parser", "Error parsing data " + e.toString());
Log.e("JSON Parser2", "json: "+json);
}
the logcat is:
01-03 16:50:09.239: E/JSON Parser(17447): Error parsing data org.json.JSONException: Value [] of type org.json.JSONArray cannot be converted to JSONObject
01-03 16:50:09.239: E/JSON Parser2(17447): json: [][][]{"code":0,"message":"Segnalazione inviata correttamente"}
in php i have:
$response = array();
$response["code"] = $e['code'];
$response["message"] = $e['message'];
echo json_encode($response);
thanks
[][][]are spurious in the json you receive.