I tried to bring HTML of a web and i use this code for doing this :
HttpClient httpClient = new DefaultHttpClient();
HttpContext localContext = new BasicHttpContext();
HttpGet httpGet = new HttpGet("http://www.google.com");
HttpResponse response;
try {
response = httpClient.execute(httpGet, localContext);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
and always in the response = httpClient.execute(httpGet, localContext); it give me exception, also in other codes that i tried
Have you tried setting the
INTERNETpermission in the manifest file?Sample code: