Add Permissions to the App Manifest

This section outlines how to add permissions to the App Manifest (AndroidManifest.xml) file. This permission mentioned enables your app to use the internet.

The App Manifest contains crucial information about your app (components such as activities, services, receivers, content providers, intent messages, processes, permissions, APIs, classes, minimum versions and libraries) and communicates this to the Android system to enable Android to run your code.

This file is also referenced in the following sections: Create Activity Styles and Configure Your Application.

To add permissions to the App Manifest

  1. From Android Studio, open your project.
  2. Navigate to the app folder, then from src > main folder, locate your AndroidManifest.xml file. App Manifest
  3. Just above the Application tag, add these two lines of code:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Info With the release of Android Marshmallow, Android switched from an install-time to a runtime permissions model. In any case, both are granted automatically if listed in the App Manifest.


results matching ""

    No results matching ""