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 7884125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:42:53+00:00 2026-06-03T04:42:53+00:00

I am sending info to a php file through a url. When I type

  • 0

I am sending info to a php file through a url. When I type the url in my browser the right information is displayed, however I do not get this information through the InputStreamReader.

Here is my code.

 try {
          URL url = new URL("http://example/example.php?userImage="
         + URLEncoder.encode(userImageString, "UTF-8") + "&userHeight="
         + URLEncoder.encode(userHeight,"UTF-8" ));
          Log.d("url", "" + url);
          Scanner in = new Scanner(new InputStreamReader(url.openStream()))
            .useDelimiter("\n");

          Log.d("hasnext?", "" + in.hasNext());
      while (in.hasNext()) 
      {
          Log.d("sent", in.next());
      }
      in.close();
    }
      catch(Exception e)
      {
          e.printStackTrace();
      }
 }

HasNext returns false, it should be returning true. Any suggestions?

I should note that the userImageString is a Base64 encoded string.

  • 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-06-03T04:42:54+00:00Added an answer on June 3, 2026 at 4:42 am

    1) Do you have the permission to access the internet?

    <uses-permission android:name="android.permission.INTERNET" />
    

    2) I think you can solve your problem with this answere:
    Make an HTTP request with android

    3) Here is a working http request which returns the response:

    public String request(String fUrl){
        String page = "";
        try
        {
            HttpClient hc = new DefaultHttpClient();
            HttpPost post = new HttpPost(fUrl);
            HttpResponse response = hc.execute(post);
    
            if(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
            {
                page = EntityUtils.toString(response.getEntity());
            }
        } catch(IOException e) {
            e.printStackTrace();
            System.out.println("Exception Thrown");
        }
        return page;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am sending info to target email via PHP native mail() method right now.
I'm sending the following info to a php file. data contains 'one' and 'two'.
my problem:--- This is my wifi_log.php file <?php // find out how many rows
I am making consecutive http get request to a PHP file on my server.
I have a problem with sending emails to gmail through Php mail() function. I
When sending data via POST or GET with jQuery you use for format {
For sending HTML document information such as content-encoding , charset , date , last-modified
I have some problems sending mails through SMTP using Spring's MailSender interface and the
I'm quite stuck with a problem sending mail from a PHP script. Some data:
I'm having an issue with a simple PHP mailer. I've had this script working,

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.