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

  • SEARCH
  • Home
  • 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 1015747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:26:50+00:00 2026-05-16T10:26:50+00:00

I want to make a http request with android. is use this: void testHTTP()

  • 0

I want to make a http request with android.

is use this:

void testHTTP()
 {
  HttpClient httpClient = new DefaultHttpClient();

  HttpUriRequest request = new HttpPost("http://www.google.com");

  try {
   HttpResponse response = httpClient.execute(request);

   //System.out.println("response protocol version: " + response.getProtocolVersion());
  } catch (ClientProtocolException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }

 }

I have the internet permission set in my manifest file.

I keep getting java.net.UnknownHostException: www.google.com

My final purpose ios to be able to invoke a web service. So, I initially tried the ksoap2 library and the proper url and got the same result.

I suspect I have some bad setting either in my app or in my emulator.

can you give me some pointers on where to look?

it would also bee useful a working example of something similar. then i could check and if the problem persists i would know that is my development setup at fault.

btw, i am using mac snow leopard with eclipse and android 2.2 as a setup

thanks

regards

  • 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-16T10:26:50+00:00Added an answer on May 16, 2026 at 10:26 am

    I’ve had problems with the emulator where the network icon shows that I have no service, and I can’t connect to the Internet. Usually, restarting the emulator fixed it. Once, I had to create a new emulator device.

    Do check for clues in the emulator/device logs. You can view them in Eclipse using the LogCat view in the DDMS perspective.

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

Sidebar

Related Questions

I want to make a HTTP Post request from C#. This request has a
I want to make a basic HTTP request using these tokens: http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html I know
I want to make an http request (I use ksoap2) in the onCreate() during
So I want to make a http request with a body (say file, file2,
i'm new to gooogle map developing.i want to make a map as follows. http://edition.cnn.com/SPECIALS/world/arab-unrest/index.html
I want to make the following HTTP request from my Java Standalone Application and
I want to make am HTTP GET request from my J2ME application using HttpConnection
I want to make an Http request and store the result in a JSONObject.
I want to make a HTTP request using Google App Engine in Go to
I want to make a POST HTTP request from a struts2 action to an

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.