Sobes.tech
Junior — Middle

What does the description in the Manifest file include and what elements does it contain?

sobes.tech AI

Answer from AI

The AndroidManifest.xml file is the main configuration file of an Android application, which describes the structure and components of the app, as well as its requirements and permissions.

Main elements contained in the manifest:

  • <manifest> — the root element, contains attributes such as package (the application's package name).

  • <application> — describes the application itself, within which components and general settings are specified:

    • <activity> — declaration of screens (Activities).
    • <service> — background services.
    • <receiver> — BroadcastReceiver for handling system and user events.
    • <provider> — ContentProvider for data exchange between applications.
  • <uses-permission> — specifies permissions needed by the app (e.g., internet access).

  • <uses-sdk> — minimum and target SDK versions.

  • <intent-filter> — describes which intents components can handle.

  • <meta-data> — additional information for components.

Example of a simple manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.app">

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

    <application
        android:label="MyApp"
        android:icon="@mipmap/ic_launcher">

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

    </application>

</manifest>

Thus, the Manifest describes the application's components, its rights, and settings necessary for proper operation in the Android system.