user265889
user265889

Reputation: 667

Android internet permission ignored

I have an application that requires the internet permission but it doesn't seem to be working for me.

I added:

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

To the manifest (above the application tag) and when I install the app my phone says: "No permissions requested" and the permission dialog doesn't show up.

However when I replace INTERNET with CAMERA like so:

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

It works fine and shows up under the permissions tab in settings.

Any ideas?

Thanks

Upvotes: 5

Views: 7337

Answers (6)

Hemanth S
Hemanth S

Reputation: 688

Only Selected permissions can be asked for user

check here which permissions can be asked by Permission manager

Upvotes: 0

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364371

If the device is running Android 6.0 (API level 23) and the app's targetSdkVersion is 23 or higher if an app declares in its manifest that it needs a normal permission, the system automatically grants the app that permission at install time.
The system does not prompt the user to grant normal permissions, and users cannot revoke these permissions.

As you can check in the official doc the INTERNET permission is normal.
Instead the CAMERA permission is dangerous.

Upvotes: 5

Heinibal
Heinibal

Reputation: 1

Android differentiates between normal permissions (e.g. INTERNET) and dangerous permissions (e.g. CAMERA). The User is only asked in case of dangerous permissions. So the behavior you see is perfectly normal.

https://developer.android.com/guide/topics/permissions/normal-permissions.html

Upvotes: 0

Mehmet K
Mehmet K

Reputation: 2814

Android only puts the dangerous permissions there. And since Camera is a dangerous permissions you see it in the list, and since Internet is not, you don't see it in the list.

Upvotes: 0

AAryan
AAryan

Reputation: 20140

You're running your app in Android SDK>=23.

Internet permission is under Normal permission so it not show any permission prompt but Camera permission is under Dangerous Permission so it show permission prompt.

If an app declares that it needs a normal permission, the system automatically grants the permission to the app.

https://developer.android.com/guide/topics/permissions/requesting.html

Upvotes: 1

131
131

Reputation: 1385

This usually does the trick for me:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Upvotes: -1

Related Questions