title: Android: Multiple webservice calls running parallely using asynctask
body: <p>Hi i would like to know how to run Multiple webservices calls parallely, Actual scenario is when my app first starts for the first time i have to call 4 different webservices  and fill the database before the user can interact with my app. can someone suggest what will be the best approach for doing this.
  Also how to use AsyncTask for running this 4 webservice calls .</p>
  
  <p>As of now i am doing one webservice call in my homeActivty using the async task</p>
  
  <pre><code>new DownloadJSON(HomeActivity.this).execute();  
  
  public class DownloadJSON extends AsyncTask&lt;Void, Void, Void&gt; {
  
      private static Context context;
          public DownloadJSON(Context context){
              this.context = context;
                  }
          @Override
      protected Void doInBackground(Void... params) {
  
      try {
          startWebServiceData();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } 
          return null 
  }
  void startWebServiceData() throws IOException {
       String URL = "xxxxxxxxxxxx";
      String SOAP_NAMESPACE = "xxxxxxxxxxxx";
      String METHOD_NAME = "xxxxxxxxxxx";
      String SOAP_ACTION = "xxxxxxxxxxxx";
      SoapObject soapObject;
  
      soapObject  = new SoapObject(SOAP_NAMESPACE, METHOD_NAME);
  
      SoapSerializationEnvelope envp = new SoapSerializationEnvelope(SoapEnvelope.VER11);
       envp.dotNet = true;
  
       envp.setOutputSoapObject(soapObject);
       System.out.println("soapObject===&gt;"+envp.bodyOut);
       HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
       try {
       androidHttpTransport.call(SOAP_ACTION, envp);
       SoapPrimitive response = (SoapPrimitive)envp.getResponse();
       String result = response.toString();
       System.out.println("response data from server====="+result);
       parseJson(result);
       } catch (Exception e) {
          }}
  
  private static void parseJson(String result) {
  
      } catch (JSONException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
  }
  } 
  </code></pre>
  
  <p>Can someonepoint me in right direction</p>