How to add manifest permission to an application?


I am trying to access HTTP link using HttpURLConnection in Android to download a file, but I am getting this warning in LogCat:

WARN/System.err(223): Permission denied (maybe missing INTERNET permission)

I have added android.Manifest.permission to my application but it's still giving the same exception.

7/17/2019 2:54:54 PM

Accepted Answer

Assuming you do not have permissions set from your LogCat error description, here is my contents for my AndroidManifest.xml file that has access to the internet:

<manifest xlmns:android...>
 <uses-permission android:name="android.permission.INTERNET" />
 <application ...

Other than that, you should be fine to download a file from the internet.

3/26/2019 4:04:15 AM

In case somebody will struggle with same issue, it is case sensitive statement, so wrong case means your application won't get the permission.


<uses-permission android:name="ANDROID.PERMISSION.INTERNET" />


<uses-permission android:name="android.permission.INTERNET" />

This issue may happen ie. on autocomplete in IDE

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow