Android The Manifest File Declaring permissions in your manifest file

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Any permission required by your application to access a protected part of the API or to interact with other applications must be declared in your AndroidManifest.xml file. This is done using the <uses-permission /> tag.

Syntax

 <uses-permission android:name="string"
    android:maxSdkVersion="integer"/>

android:name: This is the name of the required permission

android:maxSdkVersion: The highest API level at which this permission should be granted to your app. Setting this permission is optional and should only be set if the permission your app requires is no longer needed at a certain API level.

Sample AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.samplepackage">
       
    <!-- request internet permission -->
    <uses-permission android:name="android.permission.INTERNET" />

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

    <!-- request permission to write to external storage -->
    <uses-permission
         android:name="android.permission.WRITE_EXTERNAL_STORAGE"
         android:maxSdkVersion="18" />

    <application>....</application>
</manifest>

* Also see the Permissions topic.



Got any Android Question?