Android Manifest & lt; application & gt; Chinese annotation of Elements

Source: Internet
Author: User

Syntax
<Application android: allowTaskReparenting = ["true" | "false"]

Android: backupAgent = "string"

Android: debuggable = ["true" | "false"]

Android: description = "string resource"

Android: enabled = ["true" | "false"]

Android: hasCode = ["true" | "false"]

Android: hardwareAccelerated = ["true" | "false"]

Android: icon = "drawable resource"

Android: killAfterRestore = ["true" | "false"]

Android: largeHeap = ["true" | "false"]

Android: label = "string resource"

Android: logo = "drawable resource"

Android: manageSpaceActivity = "string"

Android: name = "string"

Android: permission = "string"

Android: persistent = ["true" | "false"]

Android: process = "string"

Android: restoreAnyVersion = ["true" | "false"]

Android: supportsRtl = ["true" | "false"]

Android: taskAffinity = "string"

Android: theme = "resource or theme"

Android: uiOptions = ["none" | "splitActionBarWhenNarrow"]>

...

</Application>

Parent Element
<Manifest>

Child Element
<Activity>

<Activity-alias>

<Service>

<Cycler>

<Provider>

<Uses-library>

Description
Define this application. This element contains child elements that define each application component and has attributes that can affect all application components. Most of these attributes (such as icon, label, permission, process, taskAffinity, and allowTaskReparenting) Set default values for the corresponding attributes of specific component elements. Other attributes (such as debuggable, enabled, description, and allowClearUserData) are used to set the entire application. These attributes cannot be overwritten by specific components.

Attribute
Android: allowTaskReparenting

Whether the activities defined by this application can be moved from the tasks that start them to the tasks that are associated with them (when this task is executed to the foreground)-If "true", it can be moved, otherwise, they must be together with the task to start them-"false ". The default value is "false ".

<Activity> An element has its own android: allowTaskReparenting attribute that can override this attribute value. For more information, see this attribute.

Android: backupAgent

Name of the class that implements the backup agent application. This class is a subclass of BackupAgent. This attribute value should be a complete Class Name (for example, "com. example. project. MyBackupAgent "). However, there is a short name, if the first letter of the name is a dot (for example, ". myBackupAgent), then it will be appended to the package name defined in the <manifest> element.

This property has no default value and must be specified.

Android: debuggable

Whether the application is adjustable, that is, when running on the device in user mode-If yes, it is "true"; otherwise, it is "false ". The default value is "false ".

Android: description

The user-readable text of this application has more or longer descriptive content than the label of the application. This value must be specified by referencing a string resource. Unlike label, it cannot be a raw string. No default value.

Android: enabled

Whether the android system can initialize the application component-If yes, the value is "true"; otherwise, the value is "false ". If the value is "true", the enabled attribute of each component determines whether the component is enabled. If the value is "false", it overwrites the value of the specified component; all components are disabled.

The default value is "true ".

Android: hasCode

Whether the application contains code. If the application contains code, the value is "true". Otherwise, the value is "false ". When its value is "false", the system will not try to load any application code when running the component. The default value is "true ".

If it only uses the built-in component class, the application itself will not have any code. For example, if the AliasActivity class is used, this rarely happens.

Android: hardwareAccelerated

Whether to enable hardware acceleration for all activities and all views in the application-if enabled, the value is "true"; otherwise, the value is "false ".

If you have set minSdkVersion or targetSdkVersion to "14" or higher, the value is "true"; otherwise, the value is "false ".

Since Android3.0 (API Level 11), the hardware accelerator Renderer is available to applications. This function is mainly used to improve the performance of most common 2D graphic operations. When this Renderer is enabled, most operations on Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera will be accelerated. In general, this will produce smooth animations, smooth scrolling, and improved response speed. It is even effective for applications that do not explicitly demonstrate the use of the framework's OpenGL library.

Note that not all OpenGL 2D operations are accelerated. If you have enabled the hardware accelerator, You need to test your application to ensure that it can use the Renderer correctly.

For more information, see the Hardware Acceleration wizard.

Android: icon

The application icon is also the default icon for each component of the application. See the independent icon attributes of <activity>, <activity-alias>, <service>, <Cycler>, and <provider> components.

This attribute must be set to reference drawable resources that contain images (for example, "@ drawable/icon "). No Default icon.

Android: killAfterRestore

When a problem occurs, whether the application is stopped after the complete system recovery operation is completed. Restoring a single package will never cause the application to be shut down.

Generally, the system-wide recovery operation only appears once when the phone is installed. Third-party applications generally do not use this attribute.

The default value is true, which means that the application stops after the operation is completed during the full system recovery operation.

Android: largeHeap

Whether the process you applied should be created in the larger Dalvik heap. This applies to all processes that create the application. If you use the shared user ID to allow multiple applications to use the same process, it will only apply to the first application loaded to the process, and they must all use this option, otherwise, unexpected results will appear.

Most applications do not need to do this, but focus on how to reduce their memory to improve performance. Because some devices still rely on the overall memory size, enabling this feature does not guarantee that the available memory will increase during installation.

To view available memory at runtime, you can use the getMemoryClass () or getLargeMemoryClass () method.

Android: label

The user-readable application tag is also the default tag for each application component. See the independent label attributes of <activity>, <activity-alias>, <service>, <Cycler>, and <provider> components.

This label should be set to reference the string resource so that it can be localized just like other strings in the user interface. However, for the convenience of application development, you can also directly use raw strings (hard encoding ).

Android: logo

The logo of this application is also the default logo of activities.

This attribute must be set to reference drawable resources that contain images (for example, "@ drawable/logo "). No Default logo.

Android: manageSpaceActivity

The complete identifier of the Activity subclass. The system can run this subclass to allow users to manage the memory usage of applications on the device. This activity should also be defined using the <activity> element.

Android: name

The complete name of the application subclass that implements this application. When the application process starts, this class will be initialized before all components of the application.

This subclass is optional; not required for most applications. If this application subclass does not exist, android uses the most basic Application class instance.

Android: permission

The name of the permission required for the client to interact with the application. This attribute is the most convenient way to set permissions for all components of the application. It can be rewritten by independent components themselves.

Android: persistent

Whether the application should be running at any time-if it should be "true", otherwise "false ". The default value is "false ". In general, the application does not need to set this flag; the persistence mode is used in a specific system application.

Android: process

The name of the process that all application components should run. Each component can override this default value through its own process attribute.

By default, when the first component of an application needs to run, Android creates a process for the application. All components are running in this process. The default process name matches the package name set in manifest.

By setting the name of the process that other applications can share, you can prepare the components of two applications running in the same process-only when the two applications share the same user ID and use the same certificate for signature.

If the assigned name starts with a colon (:), a new process that is private to the application is created when it is needed. If the process name starts with a lowercase letter, a global process is created. This global process can be shared by other applications to reduce resource consumption.

Android: restoreAnyVersion

The table name application is ready to restore the backup data, even if the backup is saved by a version newer than the application installed on the current device. Setting this attribute to true means that even if the new version uses incompatible data, the backup manager is allowed to try the restoration operation. Therefore, a message is required for use!

The default value of this attribute is false.

Android: supportsRtl

Declare whether your application supports the right-to-left (RTL) layout.

If it is set to true and targetSdkVersion is set to 17 or later, a large number of RTL APIs will be activated and used through the system, so your application can display the RTL layout. If it is set to false or targetSdkVersion with 16 or lower versions, this RTL APIs will be ignored or invalid, regardless of the direction selected by the user, your applications run in the same way (that is, your layout is always left-to-right ).

The default value of this attribute is false.

This attribute is added in API Level 17.

Android: taskAffinity

The affinity names of all activities applied to this application, except those components that set different values through their own taskAffinity attributes.

By default, all activities in the application share the same affinity. The affinity name matches the package name defined in the <manifest> element.

Android: theme

REFERENCE The resources of the default topic declared for all activities in this application. Each activity can also override this default value through its own theme attribute. For more information, see the Stylesand Themes wizard.

Android: uiOptions

Additional options of activity UI.

The value must be one of the following.

Value
Description
 
"None"
No additional UI options. This is the default value.
 
"SplitActionBarWhenNarrow"
When the horizontal space is limited (like when the mobile phone is portrait), add a bar at the bottom of the screen to display the action item in the ActionBar. A small number of action items are not displayed in the action bar on the top of the screen, but the action bar is divided into the top navigation bar and the bottom navigation bar for this action item. This not only ensures a reasonable amount of space available for this action item, but also for the navigation and top heading elements. Menu items cannot be divided into two bars; they always appear together.
 

For more information about this action bar, see the ActionBar developer guide.

This attribute is added in API Level 14.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.