I am trying to get array members from a PHP server to my places[] array. Actually, I have searched many topics but whenever I tried the codes it always crashed and my app always stopped unexpectedly. My json is ; Array ( [0] => 1 [1] => 1 [2] => 1 [3] => 1 [4] => 1 [5] => 1 [6] => 1 [7] => 1 [8] => 0 [9] => 1 [10] => 1 [11] => 1 [12] => 1 [13] => 1 [14] => 1 [15] => 1 [16] => 1 [17] => 1 [18] => 1 [19] => 1 ).It can be a silly question but i dont know how can i write the url for my php data.it works on my browser like <"localhost:8080/Androidconnection/parse.php"> but in the code i think i should write something different to achieve this data , and what should it be ? and also here is the code that I'm trying to get the data:
String url="http://localhost:8080/Androidconnection/parse.php";
JSONParser jParser=new JSONParser();
JSONArray json=jParser.getJSONFromUrl(url);
try {
for(int i=0;i<json.length();i++) {
JSONObject c=json.getJSONObject(i);// Used JSON Object from Android
places[i]=c.getInt("id");
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}