Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3282940
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:59:05+00:00 2026-05-17T19:59:05+00:00

Here is what I am trying to do. From my Android App code I

  • 0

Here is what I am trying to do.

From my Android App code I do an HTTP POST which is as below

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

The PHP code is supposed to send back an image and an URL.

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

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.

httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();

I retrieve the image as below and this part works.

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

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?

Thanks for all the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:59:05+00:00Added an answer on May 17, 2026 at 7:59 pm

    It’s a bit more overhead, but it might be easier if you make 2 requests to your server. That way you don’t have to worry about separating the bytes.

    For the URL request, return a text response.

    For the image request, return the bytes (as you’re doing now).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to play a sound file from an iPhone program. Here's the code:
I'm trying to debug an android app that call native code to do some
I'm trying to the the flv Flash player from here in a windows forms
Here's some background on what I'm trying to do: Open a serial port from
Basically I am trying to restart a service from a php web page. Here
I'm trying to use reflection to get a property from a class. Here is
Here's what I'm trying to do, and failing... I have a File model which
I trying to put together an Android app that will take a picture and
I am currently trying to send some data from and Android application to a
I am trying to use a sendOrderedBroadcast in my Android app. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.