title: Cannot convert Json array to Json Object in Android?
body: <p>This getAppData method in Android gives me a blank screen but if I don't convert it to Json Object it gives me this;</p>
  
  <pre><code>["x.apk","xx.apk","xxx.apk"]
  </code></pre>
  
  <p>but I want the output to be without quotation and square brackets how can achieve this ?</p>
  
  <p>PHP</p>
  
  <pre><code>$fileList = glob('xxxx/xxx/appstore_php/*');
     $files = [];
     foreach($fileList as $filename)
     {
        if ( is_file ( $filename ) )
        {
           $bname = basename ( $filename);
           $files[] = $bname;  
        }
     }
  
     header('Content-Type: application/json');
     $response = ["files" =&gt; $files];
     echo json_encode($response);
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>   {"files":["x.apk","xx.apk","xxx.apk"]}
  </code></pre>
  
  <p>Android</p>
  
  <pre><code>    private void getAppData(){
          //Creating a string request
          StringRequest stringRequest = new StringRequest(URLAddress.SHOW_ALL_APK,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      JSONObject j = null;
                      try {
                          JSONObject json = new JSONObject(response);
                          JSONArray jsonArr = json.getJSONArray("files");
                          for (int i = 0; i &lt; jsonArr.length(); i++) {
                              j = jsonArr.getJSONObject(i);
                              appList.add( j.toString() );
                          }
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
                  }
              },
              new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                  }
              });
          //Creating a request queue
          RequestQueue requestQueue = Volley.newRequestQueue(this);
  
          //Adding request to the queue
          requestQueue.add(stringRequest);
      }
  </code></pre>