Each application must have an androidmanifest. xml file in its root directory. This list submits the basic information of the application to the Android system. The information system must be established before the application code can run. The following are some things to do in the configuration file:
1. Name the application with a Java package. The package name is the unique identifier of the application;
2. Describe the components of the application --- constitute the activity, service, and broadcast of the application
Aggreger and content provider. It must be named by the Implementation class of each component and publish corresponding component functions (for example, intent messages that can be processed by the component ). These declarations enable the Android system to understand the components in the application and the conditions for these components to be loaded.
3. Determine which processes are the main application components.
4. Declare the permissions required by the application to access protected APIs and interact with other applications.
5. to interact with application components, other required permissions are also declared.
6. lists the instrumentation classes that provide analysis and other information when the application is running. These classes are declared in the inventory file only when the application is developed and tested. These classes are to be deleted before the application is released.
7. Declare the minimum Android API level required by the application.
8. List external libraries that must be linked to the application.
Structure of the manifest File
Contains the general structure of the configuration file and all elements that can be contained. All elements contained in each element are described in their respective documents.
<? 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>
<Cycler>
<Intent-filter>
... </Intent-filter>
<Meta-data/>
</Cycler>
<Provider>
<Grant-Uri-Permission/>
<Meta-data/>
</Provider>
<Uses-Library/>
</Application>
</Manifest>
The following lists all elements in the list file alphabetically. When these elements are required, the android system does not allow you to add custom elements or attributes.
<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>