views:

819

answers:

1

I was just wondering if anyone solved this problem. Googling gives tons of posts having this question but not one with a proper reply. I tried literally every combination of the following two pieces of code with and without proxy:

/*********** URL METHOD ***************/
//URLConnection conn = aURL.openConnection(); 
//conn.connect(); 
//InputStream is = conn.getInputStream(); 

/*********** HTTP METHOD ***************/
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(urlString);
HttpResponse resp = client.execute(get);

InputStream is = resp.getEntity().getContent();

I am trying to connect to a site on my intranet (its not localhost). I've tried the following:

  1. Setting Proxy inside Eclipse settings
  2. Setting my own localhost and writing a small php script that takes the url, connects to it and then gets the file from the intranet site - This works from the Browser though! It does not work when I use the 10.0.2.2 IP address

Any thoughts?

+1  A: 

The only thing that helps me is to shut down Eclipse and then kill adb.exe. After you restart Eclipse it (usually) goes away. Until next time.

DroidIn.net
So are you saying that this happens even for intranet addresses?
Legend
This actually drives me nuts because I can't find a pattern, happens behind a corporate firewall and in my home office. It simply stops working until I recycle ADB - then it reliably works (until it unreliably breaks)
DroidIn.net
I am not sure if it had something to do with eclipse too... I restarted eclipse though I did a few other changes... Because the changes were off-topic, I had a different thread going here: http://stackoverflow.com/questions/1535215/php-is-there-a-way-to-change-request-addressThanks for all the help... I will try to put up a detailed list of steps (need to figure out what steps made it to work though :) )to get this up and running sometime...
Legend
You are welcome. Thanks for looking deeper into it - I'm interested!
DroidIn.net