Skip to main content

Search 436 pages — tools, formats, elements, namespaces, directory, comparisons, XPath, datatypes, glossary, parse errors, schema errors, use cases, guides, blog and product.

XML format

Android manifest

The declaration every Android app is judged by: permissions, components and intent filters, in a namespace whose prefix is load-bearing.

AndroidManifest.xml is where an app declares what it is and what it wants: its components, the permissions it requests, the intents it responds to, and the SDK levels it supports. Play Store review, runtime permission prompts and the launcher all read it, so a mistake here is visible to users rather than to the build.

Its XML is unusual in one respect worth knowing before you generate one: almost every attribute is in the android namespace, and the prefix is conventionally android because the tooling and every piece of documentation assume it. Declaring the same URI under a different prefix is correct XML and will confuse everything that reads the file by string.

Constraints that bite

  • Attributes are namespaced — android:name, not name. An attribute written without the prefix is silently a different attribute.
  • The manifest merger combines this file with the manifests of every library dependency, so the built manifest is not the one in the source tree.
  • An activity with an intent filter but no android:exported on API 31 and above fails to install.
  • Permissions declared here are requested; on API 23 and above, dangerous ones must also be requested at runtime.
  • The file is compiled to a binary XML form in the APK, so the shipped bytes are not the text you wrote.
Root element
<manifest>
Media type
application/xml
Extensions
.xml
Namespaces
  • http://schemas.android.com/apk/res/android
XMLDir label

Specification: Android app manifest

A minimal valid document

Every example on this site is checked against the same parser the workspace uses, so what you see below is known to be well-formed.

android-manifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.app">
  <uses-permission android:name="android.permission.INTERNET"/>
  <application android:label="Example" android:icon="@mipmap/ic_launcher">
    <activity android:name=".MainActivity" android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
    </activity>
  </application>
</manifest>

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.