Android Manifest File
Understanding Android Manifest File
Android Manifest file is at the
heart of the (structure of) android app.
The platform (android) regulates
the life cycle of your app using intent, intent filters, activities, content
providers, intent receivers, your app’s permissions and even instrumentation
(enterprise enablement) for your app using the manifest file.
Every Android application must have
an AndroidManifest.xml file.
The manifest presents essential
information about the application to the Android system, information the system
must have before it can run any of the application's code. Among other things,
the manifest does the following:
- It
names the Java package for the application. The package name serves as a
unique identifier for the application.
- It
describes the components of the application — the activities, services,
broadcast receivers, and content providers that the application is
composed of.
- It
determines which processes will host application components.
- It
declares which permissions the application must have in order to access
protected parts of the API and interact with other applications.
- It
also declares the permissions that others are required to have in order to
interact with the application's components.
- It
lists the Instrumentation
classes that provide profiling and other information as the application is
running. These declarations are present in the manifest only while the
application is being developed and tested; they're removed before the
application is published.
- It
declares the minimum level of the Android API that the application
requires.
- It
lists the libraries that the application must be linked against.
Android Manifest file is at the
heart of the (structure of) android app.
The platform (android) regulates
the life cycle of your app using intent, intent filters, activities, content
providers, intent receivers, your app’s permissions and even instrumentation
(enterprise enablement) for your app using the manifest file.
Every Android application must have
an AndroidManifest.xml file.
The manifest presents essential
information about the application to the Android system, information the system
must have before it can run any of the application's code. Among other things,
the manifest does the following:
- It
names the Java package for the application. The package name serves as a
unique identifier for the application.
- It
describes the components of the application — the activities, services,
broadcast receivers, and content providers that the application is
composed of.
- It
determines which processes will host application components.
- It
declares which permissions the application must have in order to access
protected parts of the API and interact with other applications.
- It
also declares the permissions that others are required to have in order to
interact with the application's components.
- It
lists the Instrumentation
classes that provide profiling and other information as the application is
running. These declarations are present in the manifest only while the
application is being developed and tested; they're removed before the
application is published.
- It
declares the minimum level of the Android API that the application
requires.
- It
lists the libraries that the application must be linked against.
Structure of the Manifest File
The diagram
below shows the general structure of the manifest file and every element that
it can contain. Each element, along with all of its attributes, is documented
in full in a separate file. To view detailed information about any element,
click on the element name in the diagram, in the alphabetical list of elements
that follows the diagram, or on any other mention of the element name.
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<uses-permission />
<permission />
<permission-tree />
<permission-group />
<instrumentation />
<uses-sdk />
<uses-configuration />
<uses-feature />
<supports-screens />
<compatible-screens />
<supports-gl-texture />
<application>
<activity>
<intent-filter>
<action />
<category />
<data />
</intent-filter>
<meta-data />
</activity>
<activity-alias>
<intent-filter> . . . </intent-filter>
<meta-data />
</activity-alias>
<service>
<intent-filter> . . . </intent-filter>
<meta-data/>
</service>
<receiver>
<intent-filter> . . . </intent-filter>
<meta-data />
</receiver>
<provider>
<grant-uri-permission />
<meta-data />
<path-permission />
</provider>
<uses-library />
</application>
</manifest>
All the elements
that can appear in the manifest file are listed below in alphabetical order.
These are the only legal elements; you cannot add your own elements or
attributes.
Elements of manifest File
<action>
<activity>
<activity-alias>
<application>
<category>
<data>
<grant-uri-permission>
<instrumentation>
<intent-filter>
<manifest>
<meta-data>
<permission>
<permission-group>
<permission-tree>
<provider>
<receiver>
<service>
<supports-screens>
<uses-configuration>
<uses-feature>
<uses-library>
<uses-permission>
<uses-sdk>
You can add all or some of the
elements depending on your requirement
The diagram
below shows the general structure of the manifest file and every element that
it can contain. Each element, along with all of its attributes, is documented
in full in a separate file. To view detailed information about any element,
click on the element name in the diagram, in the alphabetical list of elements
that follows the diagram, or on any other mention of the element name.
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<uses-permission />
<permission />
<permission-tree />
<permission-group />
<instrumentation />
<uses-sdk />
<uses-configuration />
<uses-feature />
<supports-screens />
<compatible-screens />
<supports-gl-texture />
<application>
<activity>
<intent-filter>
<action />
<category />
<data />
</intent-filter>
<meta-data />
</activity>
<activity-alias>
<intent-filter> . . . </intent-filter>
<meta-data />
</activity-alias>
<service>
<intent-filter> . . . </intent-filter>
<meta-data/>
</service>
<receiver>
<intent-filter> . . . </intent-filter>
<meta-data />
</receiver>
<provider>
<grant-uri-permission />
<meta-data />
<path-permission />
</provider>
<uses-library />
</application>
</manifest>
All the elements
that can appear in the manifest file are listed below in alphabetical order.
These are the only legal elements; you cannot add your own elements or
attributes.
Elements of manifest File
<action>
<activity>
<activity-alias>
<application>
<category>
<data>
<grant-uri-permission>
<instrumentation>
<intent-filter>
<manifest>
<meta-data>
<permission>
<permission-group>
<permission-tree>
<provider>
<receiver>
<service>
<supports-screens>
<uses-configuration>
<uses-feature>
<uses-library>
<uses-permission>
<uses-sdk>
<activity>
<activity-alias>
<application>
<category>
<data>
<grant-uri-permission>
<instrumentation>
<intent-filter>
<manifest>
<meta-data>
<permission>
<permission-group>
<permission-tree>
<provider>
<receiver>
<service>
<supports-screens>
<uses-configuration>
<uses-feature>
<uses-library>
<uses-permission>
<uses-sdk>
Comments
Post a Comment