Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Granting Android application the android.permission.INTERNET permission while debugging on device

I'm very new to Android development and can't find the answer to this. I have specified that I need the android.permission.INTERNET permission in my manifest file but when I try to run the app on my phone it gives me a java.lang.SecurityException: Permission Denial: starting Intent error. What am I missing?

Does my app need to be signed before I can request permissions even during development?

like image 806
offex Avatar asked Mar 11 '11 22:03

offex


People also ask

Why do you need to add this code uses permission Android name Android permission internet /> at AndroidManifest xml?

Lets say you are downloading an application which must not use internet at all and if you don't require any permission for that, it might be secretly putting data on some server. You need to explicitly put internet permission in AndroidManifest. xml, so user of your app will be aware of it.

Why might you need to include the following permission to your app Android permission ACCESS_NETWORK_STATE?

The above permission Allows applications to open network sockets. Where as above ACCESS_NETWORK_STATE permission Allows applications to access information about networks. Example: If you want to load a URL in a WebView , you only need android.


1 Answers

The problem was I had put the android.permission.INTERNET in the application attributes permission box instead of specifying in the permissions tab (using Eclipse) that my application uses the permission. The correct line in the manifest is this:

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

I'm not sure what the application attributes permission is for.

like image 158
offex Avatar answered Sep 22 '22 07:09

offex