The Role of the Manifest
Every Android app must have an AndroidManifest.xml file at the root of its source set. It provides essential information to the Android build tools, the Android OS, and Google Play. As an Architect, you use the Manifest to define the 'Surface Area' of your app—what it can do, what it needs from the device, and how other apps can interact with it.
- Essential Manifest Elements
The Manifest is a structured XML document. The root <manifest> tag defines the package name, while the <application> tag contains all the components and global settings like the app icon and theme.
- Declaring Permissions
Permissions are declared outside the <application> tag. In 2026, Android follows a strict 'Least Privilege' model. You must declare 'Normal' permissions (like Internet) and 'Dangerous' permissions (like Camera) here. Dangerous permissions also require a runtime request in your Kotlin or Dart code.
- Activities and Intent Filters
Every screen (Activity) must be declared. The most important one is the MainActivity (the Flutter Runner), which contains an Intent Filter marking it as the 'Main' entry point that appears in the app launcher.
- Metadata and Queries
Modern Android (API 30+) requires the <queries> tag if your app needs to interact with other specific apps on the device (e.g., sharing a generated UI to WhatsApp). Additionally, <meta-data> tags are used to provide API keys or configuration flags for third-party libraries like Firebase or Google Maps.
Manifest Comparison: Role vs. Implementation
| Feature | Manifest Tag | Purpose |
|---|---|---|
| App Identity | package="..." | Unique ID for the Play Store |
| Permissions | <uses-permission> | Requests access to system features |
| Entry Point | <intent-filter> | Defines how the app is launched |
| Hardware | <uses-feature> | Filters devices that don't have specific hardware (e.g., NFC) |
| Styling | android:theme | Sets the global native look and feel |
| Security | android:exported | Controls if other apps can launch an Activity |