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

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -