Error with facebook connections in android -
i have problem facebook. in connection have:
url url = new url("https://www.googleapis.com/oauth2/v1/userinfo?access_token="+ token); httpurlconnection con = (httpurlconnection) url.openconnection(); int sc = con.getresponsecode();
and get:
java.net.unknownhostexception: unable resolve host "www.googleapis.com": no address associated hostname
i have permissions in manifest like:access_network , internet.
i resolve problem:
httpurlconnection con = (httpurlconnection) url.openconnection(); con.setreadtimeout(10000 /* milliseconds */); con.setconnecttimeout(15000 /* milliseconds */); con.setrequestmethod("get"); con.setdoinput(true); // starts query con.connect(); int sc = con.getresponsecode();
Comments
Post a Comment