Faced the following problem: it is necessary to parse the data from the JSON file located on a specific link. For this I use the classes org.json. *. To access the Internet connection in AndroidManifest I specify the following:
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> But when I run the application on Android 6, I get the following exception:
Permission denied (missing INTERNET permission?)
I read about the Runtime Permissions in the Android docks and realized that perhaps the problem lies in the fact that android.permission.INTERNET is a dangerous resolution and will have to add a couple of methods to request permission during program execution. But googling stumbled upon such an article from Habr , which indicates that access to the Internet is not dangerous. So what's the problem then?
upd: AndroidManifest.xml file
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ru.cargomart.cargomart" > <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/app_name" android:theme="@style/AppTheme.NoActionBar" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
compileSdkVersionandtargetSdkVersion? - post_zeew 2:49