次のようなステップが欠けていると思います。
InputStream is = conn.getInputStream();
HttpURLConnection
基本的には、電話をかけるなどconnect
の必要なことを行うために、ソケットを開くだけです。getInputStream()
getResponseCode()
URL url = new URL( "http://google.com/" );
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
if( conn.getResponseCode() == HttpURLConnection.HTTP_OK ){
InputStream is = conn.getInputStream();
// do something with the data here
}else{
InputStream err = conn.getErrorStream();
// err may have useful information.. but could be null see javadocs for more information
}