If you are using URL.openStream() and wondering why it fails half the time, stop.
Start using HttpClient, HttpGet and HttpResponse
String address = "http://www.somesiteofinterest.com"; HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(); request.setURI(new URI(address)); HttpResponse response = client.execute(request); BufferedReader in = new BufferedReader( new InputStreamReader( response.getEntity().getContent() ));