p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 (http://p2p.wrox.com/forumdisplay.php?f=432)
-   -   Unable to access web with HttpURLConnection (http://p2p.wrox.com/showthread.php?t=87495)

ackid32 May 10th, 2012 05:25 AM

Unable to access web with HttpURLConnection
 
String https_url = "http://www.google.com/";
URL url;

try {

url = new URL(https_url);
HttpURLConnection con = (HttpURLConnection)url.openConnection();
int responsecode = con.getResponseCode();

} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

In con.getResponseCode() gives error.
How to solve this?


All times are GMT -4. The time now is 08:30 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.