Introduction to AndroidManifest file

By

August 2, 2012AndroidNo comments

This is the part of Android Development series

1.What is Android ?
2.Hello world mobile application using android.
3.What is Android activity ?
4.Understanding Android layouts
5.Introduction to AndroidManifest file
6.Android programming using Intents

An Android Manifest is an XML file in the android application that holds the major role in defining the app itself.Every application has a manifest file that defines the package name that is unique to each an every application.

Sample AndroidManifest.Xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
< ?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.android.devlup"
     android:versionCode="1"
     android:versionName="1.0">
    <uses -sdk android:minSdkVersion="13" />
   

    <application android:icon="@drawable/icon" android:label="@string/app_name" android:permission="android.permission.WRITE_SMS">
        <activity android:name=".DevlupActivity"
                 android:label="@string/app_name">
            <intent -filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent>
        </activity>

    </application>
</manifest>

List of Information contained in Androidmanifest.xml

1.Activities and Intents:

Manifest file should contain all the activity information.If you create a new activity in your application you should first define it on this manifest file.

2.App Version:

Manifest file carries the version information of the app.Every modification made in the app should have incremental version number so that if the user sees an updated version if the app on google play store.

3.Permission:

While installing an application from play store you will first prompt to accept the app permissions menu.Every app needs to access certain phone resources.For example if an app needs write permission for SMS application then it should be specified (android.permission.WRITE_SMS) in android manifest file.

android permissions menu

android permissions menu

4.SDK attibutes

In manifest file you need to specify the API version that application uses.Every time when google introduces new android version it will also release the API version that makes the application to be checked for compatibility.

<uses-sdk> needs MinSDK,MaxSDK,TargetSDK version number.If you are not specifying the MinSDK version then it defaults to 1 which means the application is compatibile to all android versions.

Check out more details in android developer website

You can follow our list of Android Tutorials

Leave a Reply

*