Learn About Android Manifest.Xml File

Android Manifest file

Every application in Android has an Android manifest file that is present in its root directory. It is a XML file that works as a bridge between developers and the Android system. The Android manifest XML file allows the developer to tell all the functionalities and requirements of the application. It contains the names of the Java package for the application. It describes the component of the application Activities, Services, Broadcast Reciever and the Content Provider that the application is composed of. In this the user can interact with the application by giving the required permission to the manifest XML file.

The Android Manifest.xml is generated as a part of the build process and XML found within the properties of the \Android Manifest.xml merged with the XML generated based on custom attributes. The merging Process is trivial. It uses the custom attributes within the code to generate XML elements.


<manifest xmlns:android=http://schemas.android.com/apk/res/android
android:sharedUseLabel="string resource"
android:installation=["auto" "internally" "preferExternal" ]>

Elements of the Android manifest.xml file

These are the elements of the Android manifest.xml file that cannot be changed and you cannot add your elements to the Android Manifest file:
























Elements of application component

These should be enclosed in the <application> container:

activity: has the set of attributes based on the user interface

activity-alias: specific target activities

service: has the operation provided by any library or API , running in the background that is not visible

receiver: enables the application to receive intents that are broadcast by the system or application

provider: provides some structure to access application data

This information is needed by the system to run any file of the application. That's why this file is created during installation, not during execution.

Structure of Android Manifest file







Simple Android manifest.xml file

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"



    android:versionName="1.0" >

uses-permission android:name="android.permission.INTERNET"

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



        android:targetSdkVersion="16" />






        android:theme="@style/AppTheme" >



            android:label="@string/app_name" >


                <action android:name="android.intent.action.MAIN" />


                <category android:name="android.intent.category.LAUNCHER" />










The Android Manifest file must be the file name and should be present in a root directory.
Elements inside this have no specific order.

How to declare the class in the Manifest file



           <service  android:name="com.example.project.secretServices"




Up Next
    Ebook Download
    View all
    View all