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

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

java - UML - How would you draw a try catch in a sequence diagram? -

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