I think you are missing the next step, which looks something like this:
InputStream is = conn.getInputStream();
HttpURLConnectionbasically only opens the socket on connectto do something that you need to do something like a call getInputStream()or even bettergetResponseCode()
URL url = new URL( "http://google.com/" );
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
if( conn.getResponseCode() == HttpURLConnection.HTTP_OK ){
InputStream is = conn.getInputStream();
}else{
InputStream err = conn.getErrorStream();
}
source
share