This is a complete example:
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(yourURL);
HttpResponse response = httpclient.execute(httpget);
in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
String result = sb.toString();
Log.v("My Response :: ", result);
use the url with the protocol "https://
"
"https://www.stackoverflow.com" instead of just "www.stackoverflow.com"
be sure to have this permission into your androidmanifest.xml
<uses-permission
android:name="android.permission.INTERNET" />