title: trying to get json object from php to android
body: <p>i am trying to parse an array from my php script to my android app. 
  my android  code </p>
  
  <pre><code>public void func4(View view)throws Exception
  {final String TAG_CONTACTS = "response";
      AsyncHttpClient client = new AsyncHttpClient();
      RequestParams rp = new RequestParams();
      rp.put("pLat", "SELECT officer_name FROM iwmp_officer");
  
      client.post("http://10.0.2.2/conc3.php", rp, new AsyncHttpResponseHandler() {
          public final void onSuccess(String response) {
              // handle your response here
              ArrayList&lt;String&gt; User_List = new ArrayList&lt;String&gt;();
  
  
              try
          {
        JSONArray jArray = new JSONArray(response.toString());
         // JSONObject jsonObject = new JSONObject(response);
        for (int i = 0; i &lt; jArray.length(); i++)
        {
            JSONObject json_data = jArray.getJSONObject(i);
  
  
  
           User_List.add(json_data.getString(TAG_CONTACTS));
           String s = User_List.get(0).toString();
           tx.setText(s);
        }
  
           } 
              catch (Exception e)
          {
                  tx.setText((CharSequence) e);
           }
  
          }
  
          @Override
          public void onFailure(Throwable e, String response) {
              // something went wrong
              tx.setText(response);
          }               
      });
  }
  </code></pre>
  
  <p>now i am sending or ECHOing a jSON array from my php code, which is being read into the response object of string type.</p>
  
  <p><code>&lt;?php
         $cars=array("Volvo","BMW","Toyota");
         $arrlength=count($cars);
         echo json_encode($cars); 
          exit;
       ?&gt;</code></p>
  
  <p>now error i am getting is <strong><em>org.json.JSONException: Value Volvo at 0 of type java.lang.String cannot be converted to JSONObject</em></strong></p>
  
  <p>i think thar onSuccess func accept string parameter and i m sending json as a parameter to it.. thats what causing problem please help.</p>