How do I retrieve two field values received from an HTTP POST to PHP?
<p>Here is what I am trying to do.</p>

<p>From my Android App code I do an HTTP POST which is as below</p>

<pre><code>HttpPost httppost = new HttpPost("http://xyz.com/Retrieve.php");
</code></pre>

<p>The PHP code is supposed to send back an image and an URL.</p>

<pre><code>$q=mysql_query("SELECT image, url FROM testblob WHERE id = 'id[0]'");
list($data) = mysql_fetch_row($q);
echo $data;
</code></pre>

<p>Now in my Android code I do the following and the image is retrieved perfect from the response but how do I retrieve the URL as well.</p>

<pre><code>httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();
</code></pre>

<p>I retrieve the image as below and this part works.</p>

<pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int n = 0;
while ((n=is.read(buf))&gt;=0)
    {
    baos.write(buf, 0, n);
    }
    is.close();
    byte[] bytes = baos.toByteArray();
    Bitmap bitmap2 = null;
    bitmap2 = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
</code></pre>

<p>So I would like to know if both the image and the url is received in the InputStream is object and if yes how do I retrieve the URL out of it?</p>

<p>Thanks for all the help.</p>
