Interview QuestionPractical QuestionFollow-up Questions

AndroidManifest.xml

skydovesJaewoong Eum (skydoves)||8 min read

AndroidManifest.xml

The AndroidManifest.xml file is a required configuration file at the root of every Android application module. It declares the application's components, permissions, hardware requirements, and metadata to the Android operating system. The system reads this file before launching any part of the application, making it the primary contract between the app and the platform. By the end of this lesson, you will be able to:

  • Describe the role of the manifest in component registration and process startup.
  • Explain how permissions, intent filters, and feature declarations work.
  • Identify how the manifest merge process combines multiple manifest files.
  • Recognize common mistakes in manifest configuration and their effects.

Component Registration

Every Activity, Service, BroadcastReceiver, and ContentProvider must be declared in the manifest for the system to recognize it. The system uses these declarations to determine how to start each component and what process it runs in.

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">

    <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>

    <service android:name=".SyncService" />
    <receiver android:name=".BootReceiver" />
</application>

The intent-filter on MainActivity tells the launcher to display this activity as an entry point. Without it, the app would install but would not appear in the app drawer. The android:exported attribute controls whether other applications can start the component.

Permissions

The manifest declares both the permissions the app requests and the permissions it defines for its own components. Requested permissions appear as uses-permission elements:

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

Starting with Android 6.0 (API 23), dangerous permissions like location require runtime consent in addition to the manifest declaration. The manifest declaration is still required because the system checks it before presenting the runtime dialog.

You can also define custom permissions for your own components using permission elements, which lets other apps request access through the same permission model.

Hardware and Software Feature Declarations

The uses-feature element tells the Play Store which hardware or software features the app requires. Devices that lack a declared feature will not see the app in the store:

This interview continues for subscribers

Subscribe to Dove Letter for full access to exclusive interviews about Android and Kotlin development.

Become a Sponsor