웹서버에서 json파일을 갖고오는데는 성공했습니다. 아래 로그 보시면 원본하고 치환해서 JSONObject가 읽을 수 있게 String 치환해줬구요. 근데 여기서 JSONObject 객체가 생성되지 않네요 ㅠ 지금 이거때문에 하루 종일 삽질하구 있네요 ㅠ 부탁드립니다 ㅠㅠ


public static JSONObject getJSONfromURL("String url){
//initialize
InputStream is = null;
String result = "";
JSONObject jArray = null;

//http post
try{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();

}catch(Exception e){
Log.e("log_tag", "Error in http connection "+e.toString());
}

//convert response to string
try{
BufferedReader reader = new BufferedReader(new InputStreamReader(is,"UTF-8"),8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
result=sb.toString();
result = "\""+result.replace("\"","\\\"")+"\"";
}catch(Exception e){
Log.e("log_tag", "Error converting result "+e.toString());
}
//try parse the string to a JSON object
try{
Log.d("JSON STRING", result);
        jArray = new JSONObject(result); //여기서 에러가 납니다.
}catch(JSONException e){
Log.e("log_tag", "Error parsing data "+e.toString());
}

return jArray;
}


03-20 06:24:59.403: D/JSON STRING(818): "{\"result\":\"success\",\"data\":[]}
03-20 06:24:59.403: D/JSON STRING(818): "
03-20 06:24:59.414: E/log_tag(818): Error parsing data org.json.JSONException: Value {"result":"success","data":[]}
03-20 06:24:59.414: E/log_tag(818):  of type java.lang.String cannot be converted to JSONObject
03-20 06:26:32.914: W/KeyCharacterMap(818): No keyboard for id 0
03-20 06:26:32.914: W/KeyCharacterMap(818): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
03-20 06:26:36.533: D/dalvikvm(818): GC_FOR_MALLOC freed 9945 objects / 674880 bytes in 66ms
03-20 06:26:39.103: W/KeyCharacterMap(818): No keyboard for id 0
03-20 06:26:39.103: W/KeyCharacterMap(818): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
03-20 06:26:41.443: D/dalvikvm(818): GC_EXTERNAL_ALLOC freed 19683 objects / 1621200 bytes in 63ms
03-20 06:26:46.167: D/dalvikvm(818): GC_FOR_MALLOC freed 7557 objects / 497360 bytes in 69ms
03-20 06:26:49.216: D/JSON STRING(818): "{\"result\":\"success\",\"data\":[{\"STOP\":\"250001658\"}]}
03-20 06:26:49.216: D/JSON STRING(818): "
03-20 06:26:49.216: E/log_tag(818): Error parsing data org.json.JSONException: Value {"result":"success","data":[{"STOP":"250001658"}]}
03-20 06:26:49.216: E/log_tag(818):  of type java.lang.String cannot be converted to JSONObject