Note that there are some explanatory texts on larger screens.

plurals
  1. POSend php file1 response to android immediately and then call another php file2 from file1
    text
    copied!<p>I call file1.php from android and I want it to send xml response to android and immediately after that call file2.php from file1.php. I also want to send an array from file1.php to file2.php. How can this be done without delaying sending the response to android as android needs response only from file1. But file2 input is file1's output. So is there a way in which i can send file1's xml output to android and then call file2 immediately after that? </p> <p>Details : Android :-> Display near by restaurants using google places api. </p> <p>File1.php :-> Get the list of near by restaurants google places api and send it to android. Immediately after this I want to call File2.php from File1.php where I send the reference id's of the restaurants(o/p of File1) so that i can get each restaurants details.</p> <p>Android Code:</p> <pre><code>ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2); nameValuePairs.add(new BasicNameValuePair("latitude",latt)); nameValuePairs.add(new BasicNameValuePair("longitude", longi)); DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost("http://www.xyz.com/file1.php"); httpPost.setEntity(new UrlEncodedFormEntity (nameValuePairs)); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); line = EntityUtils.toString(httpEntity); </code></pre> <p>File1.php</p> <pre><code> $url = 'https://maps.googleapis.com/maps/api/place/search/xml?....'; //get xml response and send it to android //call file2.php and send reference id's so as ot get each restaurant details </code></pre> <p>File2.php</p> <pre><code>for(each restaurant) //get details and do some back end processing. </code></pre> <p>Main thing is android should receive response before file2 starts executing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload