官术网_书友最值得收藏!

Adding networking permissions

Android requires applications to explicitly request permissions in order to access many features. This is done in order to present the user with an option to deny specific permissions, and prevent applications from doing something different from what the user expects.

Since we will be doing network requests, we will need to add the internet permission to the manifest of the application. Let's locate the AndroidManifest.xml file in the app/src/main directory, and edit it:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.starcarr.rssreader">
<uses-permission android:name="android.permission.INTERNET" />
<application
...
</manifest>
The name  Internet is not accurate. This permission is needed in order to do any network request regardless of it actually reaching the internet – for example, it could be a LAN request. This permission has to be thought of as Networking.
主站蜘蛛池模板: 聂拉木县| 巴楚县| 长乐市| 湘潭县| 厦门市| 石景山区| 巴南区| 丹东市| 焦作市| 衡水市| 于田县| 驻马店市| 乌什县| 亚东县| 宕昌县| 内江市| 平邑县| 榆林市| 甘南县| 武城县| 武威市| 清水河县| 遂平县| 通渭县| 济阳县| 梅河口市| 临沭县| 通道| 常熟市| 苍南县| 乌恰县| 新沂市| 神木县| 岳西县| 大邑县| 宜宾县| 湾仔区| 新泰市| 赤壁市| 安阳县| 建始县|