The following code throws permision denied expection
String strurl = "https://login.yahoo.com/WSLogin/V1/get_auth_token?&login=name&passwd=passwd&oauth_consumer_key=dj0yJmk9WnhsVVZvSDhkYTVpJmQ9WVdrOWMwRlVZV0p2TkRnbWNHbzlNVFE0TURJek5qVTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD0yNg";
URL url;
try
{
url = new URL(strurl);
HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
System.out.println(urlConnection.getInputStream());
}
catch (MalformedURLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
If I use the URL directly in the browser I get a proper response in this case a request token is displayed. What is the problem here; is there any other way if calling it?
I am not experienced with Android development but don't you have to define permissions in manifest xml to access network? (I suppose that you execute that code from Android by your tag)