Anatomy of an Android App

Sep 10 2024 · Kotlin 1.9.23, Android 14, Android Studio Iguana

Lesson 03: Explore the Android Manifest

Demo

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In this demo, you’ll explore key aspects of the Android manifest file and learn how to configure various app settings. We’ll cover changing the launch activity, modifying the app icon, adding permissions, and setting the app name.

Changing the Launch Activity

First, let’s look at how to change which activity is launched when the app loads:

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

<activity
    android:name=".MainActivity"
    android:exported="false">
</activity>

Changing the App Icon

The app icon is specified in the manifest under the <application> tag:

<application
    android:icon="@mipmap/ic_launcher"
    android:roundIcon="@mipmap/ic_launcher_round"
    ...>

Adding Permissions

Permissions are added to the manifest file using the <uses-permission> tag. For example:

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

Setting the App Name

The app name is typically set in the strings.xml resource file and referenced in the manifest:

Conclusion

This demo covered key aspects of configuring your Android app through the manifest file. Remember to rebuild and run your app after making changes to see them take effect. For more advanced topics and best practices, refer to the official Android documentation and additional learning resources.

See forum comments
Cinema mode Download course materials from Github
Previous: The App Manifest Next: Conclusion