title: get json array from web service url
body: <p>I want to get some json object or son array from my prestashop web service. I can get my json in browser by url with AppKey. but this request not worked in android request.my son object is null because http request can't receive it. <strong>my question is how to get this son by request in android , browsers can get it successfully.</strong></p>
  
  <p>this is my json response in browser:</p>
  
  <pre><code>{"products":[{"id":107},{"id":120},{"id":767},{"id":26},{"id":27}]}
  </code></pre>
  
  <p>but I can't get this json in android, or maybe my request is wrong:</p>
  
  <pre><code>public class Asyncs {
  JSONParser jParser = new JSONParser();
  JSONArray jsonArrays = new JSONArray();
  
   public class GetProduct extends AsyncTask&lt;String, String, ArrayList&lt;String&gt;&gt; {
  
      ArrayList&lt;String&gt; test = new ArrayList&lt;&gt;();
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
      }
      protected ArrayList&lt;String&gt; doInBackground(
              String... args) {
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
          JSONObject json = jParser.makeHttpRequest("http://MyApp-Key@elsevan.com/api/products", "GET", params);
          Log.d(" Products: &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ", json.toString());
          try {
              for (int i = 0; i &lt; jsonArrays.length(); i++) {
                  JSONObject c = jsonArrays.getJSONObject(i);
              }
  
          } catch (JSONException e) {
                  e.printStackTrace();
          }
          return test;
      }
      @Override
      protected void onPostExecute(final ArrayList&lt;String&gt; result) {
  
      }
  }
  }
  </code></pre>
  
  <p>my log:</p>
  
  <pre><code>2540-2553/? E/JSON Parser﹕ Error parsing data org.json.JSONException: End of input at character 0 of
  09-03 12:43:20.444    2540-2553/? W/dalvikvm﹕ threadid=10: thread exiting with uncaught exception (group=0xa6270288)
  09-03 12:43:20.444    2540-2553/? E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
  java.lang.RuntimeException: An error occured while executing doInBackground()
          at android.os.AsyncTask$3.done(AsyncTask.java:299)
          at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
          at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
          at java.util.concurrent.FutureTask.run(FutureTask.java:137)
          at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
          at java.lang.Thread.run(Thread.java:856)
   Caused by: java.lang.NullPointerException
          at Requests.Asyncs$GetProduct.doInBackground(Asyncs.java:61)
          at Requests.Asyncs$GetProduct.doInBackground(Asyncs.java:31)
          at android.os.AsyncTask$2.call(AsyncTask.java:287)
  </code></pre>