title: Volley synchronous requests
body: <p>I need to make five requests and parse the results only when all 5 are completed, in a traditional way i will implement and intent service do the five requests with HttpURLConnection from java.net or similar library and parse the results. However i'm experimenting Volley and i need synchronous requests i'm thinking of doing it like this:</p>
  
  <pre><code>ArrayList&lt;RequestFuture&lt;JSONObject&gt;&gt; futures = new ArrayList&lt;RequestFuture&lt;JSONObject&gt;&gt;();
  String url;
  int i = 0;   
  while(i&lt;5){
  
    url = //get the url for each request;
  
    //Create futures
    RequestFuture&lt;JSONObject&gt; future = RequestFuture.newFuture();
  
    //Add it to arrayList
    futures.add(future);
  
    //Queue it
    requestQueue.add(new JsonObjectRequest(url, new JSONObject(), future, future));
  
    i++
  }
  
  //Wait for each one to complete
  for( RequestFuture future : futures){
  
    try {
  
      future.get(); // get the result possibly save each result and then process it
  
    } catch (InterruptedException e) {
      // exception handling
    } catch (ExecutionException e) {
      // exception handling
    }
  }
  </code></pre>
  
  <p>Is this the way to go ? Or is there any other alternative, there isn't much Volley documentation out there.</p>