Activities and Intents Tutorial: Manifest
Manifest: Definition
Before we cover the key concepts of Activity and Intent, it’s important to understand one key aspect of an Android application – the manifest file (AndroidManifest.xml). This file is present in the root folder for every Android application and it provides the following information. We co-relate the information in Manifest file to the Hello World application developed as part of Module 1
- Package Name – In Hello World app, this was set to com.learncomputer
- Version – By default, it’s set to 1.0
- Minimum SDK Version – Specifies the Google API level, in our case, we set it to 2.3.3 (API Level 10)
- Resources including the launcher icon and the application name
- List of Activities
(MAIN), category (LAUNCHER) and the relevant intent filters. We’ll discuss these at length in the subsequent sections of this module.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.learncomputer"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".HelloWorldActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>