Reputation: 242
Here's my code:
URL url = new URL("http://www.bing.com/");
URLConnection urlConnection = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) System.out.println(inputLine);
in.close();
In the manifest, I have this:
<permission android:name="android.permission.INTERNET"></permission>
It is outside the application tab, but inside the manifest tag.
And the error I'm getting is this:
java.net.SocketException: Permission denied (maybe missing INTERNET permission)
Really not sure why I'm getting this error when I have the internet permission in place. A bit stumped here!
Thanks!
Upvotes: 4
Views: 6286
Reputation: 14376
Shouldn't you have the following?
<uses-permission android:name="android.permission.INTERNET"/>
(Note the spelling modification between permission and uses-permission)
Upvotes: 11