Detailed interpretation of application tag in Android system

  • 2021-07-10 20:38:03
  • OfStack

< application / > : Declaration of the application.
This element contains child elements, which declare the applied components, and the attributes of the element will affect all components under the application. Many properties have default values for the component, and some have global values that cannot be modified by the component.
< application > Describes the components contained in the application, and its properties affect all of its child node components. Properties such as icon/lable/permission set a default value for child node components and can be overridden. However, attributes such as debuggable/enabled are global attributes of the whole application and cannot be overridden.


<application> 
  
  <application android:allowClearUserData=["true" | "false"] 
       android:allowTaskReparenting=["true" | "false"] 
       android:backupAgent="string" 
       android:debuggable=["true" | "false"] 
       android:description="string resource" 
       android:enabled=["true" | "false"] 
       android:hasCode=["true" | "false"] 
       android:icon="drawable resource" 
       android:killAfterRestore=["true" | "false"] 
       android:label="string resource" 
       android:manageSpaceActivity="string" 
       android:name="string" 
       android:permission="string" 
       android:persistent=["true" | "false"] 
       android:process="string" 
       android:restoreAnyVersion=["true" | "false"] 
       android:taskAffinity="string" 
       android:theme="resource or theme" > 
    . . . 
  </application> 

Included in: < manifest > Element.
You can include:


<activity>
<activity-alias>
<service>
<receiver>
<provider>
<uses-library>

Attributes:
1. android: allowClearUserData
Whether to give users the right to delete user data, if it is true application manager has the right to clear data; false does not. The default is true.
2. android: allowTaskReparenting
Whether the activities defined by the application can be transferred from the initiated task to the same task that it has and will be brought to the foreground. true They can be transferred, if it's false,
They must start their mission and keep it at 1. The default is false.
3. android: backupAgent
The class name of the backup agent that implements the application, a subclass of BackupAgent. The name of this property should be a fully qualified class name (for example, "com. example. project. MyBackupAgent").
However, if the first letter of the name is set to a dot, it can also be a class name (for example, ". MyBackupAgent"), which will be appended to the < manifest > After the package name defined in the.
There is no default value.
4. android: debuggable
Whether the application can use debug or even run in user mode. true can, false can't. The default is false.
5. android: description
User-readable, longer and more application descriptions than application tags. This value must be 1 reference string. Unlike labels, it cannot be set to a hard-coded string. There is no default value.
6. android: enabled
Whether the Android system can instantiate the applied components. If it is true, it is ok, if it is false, it is not ok. If it is true, the enabled attribute of each component determines this component
Is available. If it is false, he overrides the specified value of the component, and all components will not be used. The default is true.
7. android: hasCode
Whether the application contains code. true for inclusion and false for exclusion. When the value is false, the system will not try to load any code of the application at the startup component. The default is true.
8. android: icon
The icon for the entire application, or the default icon for each component. This property value must be set to a reference to an drawable resource. There is no default value.
9. android: killAfterRestore
In an integer system reset operation, whether the application should be terminated when its settings are reset. The reset operation of a single package will not cause the application to be closed. The recovery operation of the whole system only represents
Sex occurs once, when the phone is set for the first time. This property will not be used frequently by third-party applications.
The default value is true, which means that when the whole system is restored, the application will terminate after playing with its data.
10. android: label
1 easy-to-read application label, and it is also the default label for each component of the application. This tag should be set to reference string resources, of course, it can also be used in the user like other string 1
Interface. However, for convenience, undefined strings can be set during application development.
11. android: manageSpaceActivity
The fully qualified name of an Activity subclass that can be booted by the system to allow the user to manage the storage space occupied by the application. This Activity should also be used < activity > Element declaration.
12. android: name
The fully qualified name of the Application subclass implemented for this application. When the application starts, this class will be instantiated before other components of the application.
This subclass is optional; Most applications don't. By default, Android uses instances of the basic Application class.
13. android: permission
The name of the license that the customer must set in order to interact with the application. This property is a convenient way to set permissions for applied components. It can be overridden by the permission property of the component.
14. android: persistent
Whether the application keeps running at all times. true is, false is not. The default is false. Usually, applications should not set this identity. Persistent patterns are specified by only a few system applications.
15. android: process
Set a running process name for the component under the application. Each component can define its own process name by setting its own process property.
By default, Android creates a process for the application when the first component of the application needs to run. All components run under the same process. The name of this process and the name of the < manifest >
Element sets the same backage attribute name.
By setting this property to be shared among other applications, you can coordinate the application's components to run in the same process, but only two applications share the user ID and sign the same certificate.
If the name of this property starts with a colon (":"), a new private process will be created. If the name of a process begins with a lowercase letter, a public process will be created.
A common process can be shared by other applications to reduce the use of resources.
16. android: restoreAnyVersion
Indicates that the application is ready to try to restore all backup data sets, even if the backup data is stored with a higher number than the currently installed application. Setting to true will allow backup managers to try
Restore when versions do not match, which means data conflict. Use with care. The default is false.
17. android: taskAffinity
Similar names provided to all components under the application, except those with their own taskAffinity attributes. By default, all components use the same affinity. Name of Affinity
And in < manifest > The package name set in the element is the same.
18. android: theme
Defines a topic referenced from the style resource for the component under application. Individual activities can set their own theme by setting their own theme properties.


Related articles: