AndroidManifest.xml

Basic behaviour of Android applications can be configured by editing AndroidManifest.xml file. It is located under android folder inside your monaca project as shown below:

For Cordova 6.2 or higher, AndroidManifest.xml file is removed from Monaca framework. Therefore, in order to config Android application settings, use Android Configuration Page.

AndroidManifest.xml (Main elements)

<?xml version="1.0" encoding="utf-8"?>
<manifest>

  <uses-permission />
  <uses-sdk />
  <uses-feature />
  <supports-screens />

  <application>
    <activity>
        <intent-filter>
            <action />
            <category />
        </intent-filter>
    </activity>
  </application>

</manifest>

<manifest>

Is the root element of AndroidManifest.xml file. The child element of <manifest> is <application> and it must contain xlmns:android and package attributes.

Example

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="%%%VERSION_CODE%%%"
    android:versionName="%%%VERSION_NAME%%%" package="%%%PACKAGE_NAME%%%">
</manifest>

<uses-sdk>

Is API level settings of the application. This element is contained in <manifest>.

Example

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />

<uses-permission>

Is permission settings. The permission is granted When the application is installed. This element is contained in <manifest>.

How to Define <uses-permission>

<components/loader.js> needs ACCESS_NETWORK_STATE permission to run. You may exclude this file from <uses-permission> if it's not necessary for your application.

<uses-permission android:name="%%%PERMISSION_NAME%%%"></uses-permission>

Example

Permissions for Camera

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

<uses-feature>

Declares hardware or software features used by the application. For instance. If the application requires Camera feature, the user whose device has no camera cannot install the application. This element is contained in <manifest>.

Example

The code below specifies that the application needs Camera feature.

<uses-feature android:name="android.hardware.camera" android:required="true" />

<application>

Is an Application tag. This element is contained in <manifest>.

<application android:icon="@drawable/icon"
             android:label="%%%APPLICATION_NAME%%%"
             android:name="mobi.monaca.framework.MonacaApplication">
</application>

<intent-filter>

Defines the process of intent filter. This element is contained in <activity>. The child <action> element must be defined.

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<action>

Specifies an action for an intent filter. The element is contained in <intent-filter>.

<category>

Specifies the category of the intent filter. The element is contained in <intent-filter>.

Last updated