title: Json Results Returns null
body: <p>I am New to Android.i want to fetch data from local host. </p>
  
  <pre><code>String cus_id = etcusid.getText().toString();
  new cusdataAsynTask().execute(cus_id);
  
  public class cusdataAsynTask extends AsyncTask&lt;String, Void, Void&gt; {
  @Override
          protected Void doInBackground(String... params) {
              String nvpcusid = params[0];
              List&lt;NameValuePair&gt; arg = new ArrayList&lt;NameValuePair&gt;();
              Log.e("nvpcusid: ", "&gt; " + nvpcusid);
  
              arg.add(new BasicNameValuePair("cus_id", nvpcusid));
  ServiceHandler jsonParser = new ServiceHandler();
              String json = jsonParser.makeServiceCall(URL_CUSTOMERDATA,
                      ServiceHandler.GET,arg);
              Log.e("Response: ", "&gt; " + json);
  }
  }
  </code></pre>
  
  <p>In Log i get response as null;</p>
  
  <p>Service Handler class is given below</p>
  
  <pre><code>public class ServiceHandler {
  
      static InputStream is = null;
      static String response = null;
      public final static int GET = 1;
      public final static int POST = 2;
  
      public ServiceHandler() {
  
      }
  
      /*
       * Making service call
       * @url - url to make request
       * @method - http request method
       * */
      public String makeServiceCall(String url, int method) {
          return this.makeServiceCall(url, method, null);
      }
  
      /*
       * Making service call
       * @url - url to make request
       * @method - http request method
       * @params - http request params
       * */
      public String makeServiceCall(String url, int method,
              List&lt;NameValuePair&gt; params) {
          try {
              // http client
              DefaultHttpClient httpClient = new DefaultHttpClient();
              HttpEntity httpEntity = null;
              HttpResponse httpResponse = null;
  
              // Checking http request method type
              if (method == POST) {
                  HttpPost httpPost = new HttpPost(url);
                  // adding post params
                  if (params != null) {
                      httpPost.setEntity(new UrlEncodedFormEntity(params));
                  }
  
                  httpResponse = httpClient.execute(httpPost);
  
              } else if (method == GET) {
                  // appending params to url
                  if (params != null) {
                      String paramString = URLEncodedUtils
                              .format(params, "utf-8");
                      url += "?" + paramString;
                  }
                  HttpGet httpGet = new HttpGet(url);
  
                  httpResponse = httpClient.execute(httpGet);
  
              }
              httpEntity = httpResponse.getEntity();
              is = httpEntity.getContent();
  
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          } catch (ClientProtocolException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          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();
              response = sb.toString();
          } catch (Exception e) {
              Log.e("Buffer Error", "Error: " + e.toString());
          }
  
          return response;
  
      }
  </code></pre>
  
  <p>}</p>
  
  <p>I am a beginner in this .please help me. </p>