Android Development-api Guide-<application>

Source: Internet
Author: User

<application>

English Original: http://developer.android.com/guide/topics/manifest/application-element.html
Acquisition (update) Date: 2014-5-30
Update the old document and congratulate yourself on your 42-year-old birthday.
Moved from the original blog: http://blog.sina.com.cn/s/blog_48d491300100zmga.html

Grammar:
<Applicationandroid:allowtaskreparenting=["true"| "false"] android:allowbackup=["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:requiredaccounttype= "string"Android:restrictedaccounttype= "string"Android:supportsrtl=["true"| "false"] android:taskaffinity= "string"android:testonly=["true"| "false"] android:theme= "resource or theme"android:uioptions=["None"| "Splitactionbarwhennarrow"] android:vmsafemode=["true"| "False"]>    . . .</Application>
Included in:
<manifest>
can include:
<activity>
<activity-alias>
<meta-data>
<service>
<receiver>
<provider>
<uses-library>
Description
The
declaration of the application. This element contains the child elements that declare each program component, and the properties that act on all components. Many properties (such as,,,, icon label permission process taskAffinity and allowTaskReparenting ) set the default value for the corresponding attribute in the component element. Other properties (such as debuggable , enabled ,, description and allowClearUserData ) set the global property value of the application and cannot be overridden by the component's property values.
Property:
android:allowTaskReparenting
When a task with the same affinity name is about to return to the foreground, will the application's Activity be transferred from the task at startup to the task-" true " means that it can be moved, "" means that it false must remain in the task at startup, the missing The save value is "false".

<activity>Element has its own allowTaskReparenting property, which can override this value. Please refer to its description for details.

android:allowbackup
whether the application is allowed to participate in the backup and restore mechanism. If this property is set to False, backup and recovery of the application will not be performed, even if the system-wide backup is performed. The backup mechanism will save all the data for the application through ADB. The default value for this property is true.
android:backupAgent
implement the class name of the application backup agent, which is BackupAgent the subclass. The value of this property should be a fully qualified class name (such as "com.example.project.MyBackupAgent"). However, for short, if the first character of the name is a period (for example, ". Mybackupagent "), the <manifest> package name set in the element is automatically added to the front.

There is no default value, you must specify a name.

android:debuggable
whether the application can be debugged, even when running in user mode on the device-" true " means yes, " false " means not allowed.

The default value is "false".

android:description
the application description information for the user to read is more and more detailed than the content of the label. This property value must be set to a reference to a string resource. Unlike label, this property cannot be set directly to a string.

There is no default value.

android:enabled
whether the Android system can instantiate each component in the application-" true " means yes, " false " means not allowed. If this value is set to " true ", the properties of each enabled component determine whether it is enabled or disabled by itself. If this value is set to false , the set value of the component is overwritten and all components are disabled.

The default value is "true".

android:hasCode
whether the application contains code-" true " means contains, " false " means not included. If this value is set to false , the system does not attempt to load any program code when the component is started. The default value is "true".

Applications that do not contain any own code rarely occur. This is possible only if the built-in component classes are used, such as the AliasActivity Activity of the class.

android:hardwareAccelerated
Whether hardware-accelerated rendering is enabled for all Activity and View in the application-" true " means on, "" false indicates off. If minSdkVersion targetSdkVersion the or value is greater than or equal to "14", the default value for this property is " true ". Otherwise, the default value is " false ".

Starting with Android 3.0 (API level 11), applications can use the hardware-accelerated OpenGL rendering feature to improve the performance of many common 2D graphics operations. When hardware-accelerated rendering is turned on, most of the actions in Canvas, Paint, Xfermode, Colorfilter, Shader, and Camera are accelerated. Even if the application does not explicitly call the system's OpenGL library, it can still make the animation smoother, the screen scrolling smoother, and the overall responsiveness improved.

Please note that not all OpenGL 2D operations will be accelerated. If hardware accelerated rendering is turned on, test the application to make sure that no errors occur when using rendering.

For more information, see the Hardware Acceleration Guide.

android:icon
represents the icon for the entire application, which is also the default icon for each component in the application. See,,,, <activity> <activity-alias> <service> <receiver>  and <provider> the attributes of each element icon .

This property must be set to a reference to the drawable resource (for example, " @drawable/icon "). The icon does not have a default value.

android:killAfterRestore
when performing a system-wide recovery operation, configure whether the associated application will be terminated after recovery. A single package recovery operation does not cause the program to be closed. System-wide recovery operations typically occur only once, when the phone is configured for the first time. Third-party applications typically do not need to use this property.

The default value is " true ", which means that during full system recovery, the application is shut down after processing the data.

android:largeHeap
whether the application's process will be created with a larger Dalvik heap. This will work for all processes created for the application, but only for the first application that is loaded into the process. If multiple applications are shared by a single process by sharing a user ID, these applications must all specify this option, or it will result in unpredictable consequences.

Most applications do not need to use this property, but should focus on how to reduce memory consumption to improve performance. Using this property does not guarantee that the available memory will be increased because the memory available to some devices is inherently limited.

To query the available memory size at run time, use the getMemoryClass() or getLargeMemoryClass() method.

android:label
A text label for the entire application that the user can read, which is the default label for each component in the application. See,,,, <activity> <activity-alias> <service> <receiver>  and <provider> the attributes of each element label .

The text label should be set as a reference to a string resource so that it can be localized like a string in another user interface. However, given the convenience of development, you can also set it directly to a string.

android:logo
The logo of the
entire application, which is the default logo for each Activity.

This property must be set to a reference to the drawable resource that contains the picture file (for example, " @drawable/logo "). Logo does not have a default value.

android:manageSpaceActivity
Specifies the fully qualified name of an activity subclass that the system can initiate to allow the user to manage the memory space occupied by the application. This Activity must have been declared with the <activity> element.
android:name
implements the Application fully qualified name of the subclass of this application. When the application starts running, this class will be initialized before all program components.

This subclass is optional: Most applications do not need to be used. When a subclass is not provided, Android uses an instance of the application class.

android:permission
the name of the permission that the client must have to interact with the application. This property provides a convenient way to set permissions that apply to all program components at once. It can be overridden by the individual properties of the component permission .

For more information about permissions, see the Permissions section in the introduction article and another document security and permissions.

android:persistent
whether the application needs to remain running-" true " means yes, " false " indicates no. The default value is " false ". In general, applications should not set this flag; The persistence mode is only available for certain system applications.
android:process
The
name of the process in which all components of the application will run. Each component process can override this default value by setting its own properties.

By default, when you need to run the first component of your application, Android creates a process for the program. Then all the components will run in this process. The name of the default process is the <manifest> same as the package name set by the element.

By setting this property to the process name of another application, you can have the components of two applications run in the same process-but only if the two programs share the same user ID and sign the same certificate.

If the name given to this property begins with a colon (': '), a new private process will be created for the application if necessary. If the process name starts with a lowercase letter, a global process named with this name is created. Global processes can be shared by other applications to reduce the resource footprint.

android:restoreAnyVersion
Indicates whether the application will attempt to recover any backup datasets, even if the program version of the backup data is newer than the current installation. This property is set to true allow Backup Manager to attempt a recovery operation even if a version conflict occurs, or if the data version is incompatible. Be careful when using this property!

The default value for this property is " false ".

android:requiredAccountType
set the account type required for the application. If the application requires a single Account function, the value of this property must match the authentication type of the account ( AuthenticatorDescription defined), such as "Com.google".

The default value is null, which means that the application does not need any accounts to run.

Because the current Limited User Configuration feature (Restricted profile) cannot add an account, the application Setting this property is not available to limited users unless you android:restrictedAccountType also declare the same value.

Caution If the account data may reveal personally identifiable information, it is important to declare this attribute, and to set it to android:restrictedAccountType null so that restricted users cannot use your application to access the personal information of the host computer.

This property is added from API level 18.

android:restrictedAccountType
Set the type of account required for this application and allow restricted users to access the account of the owner of the machine. If the application needs to be used Account and allows restricted users access to the master account, this property value must match the application's account authentication type ( AuthenticatorDescription defined), such as "Com.google".

The default value is null, which means that the application does not need any accounts to run.

Reminder: Setting this property will allow limited users to use your application through the master account, which may reveal personally identifiable information. If the account may disclose personal information, do not use this property, but use the android:requiredAccountType attribute to prohibit the use of restricted users.

This property is added from API level 18.

android:supportsRtl
declares whether the application supports a right-to-left (RTL) layout (layout).

If this property is set to true and targetSdkVersion above version 17, the system will activate and use various RTL APIs, and the application can display RTL Layout. If this property is set to a false version of or targetSdkVersion below 16, the RTL API will be ignored or invalidated, and the application will ignore the user localization options associated with layout orientation (layout will be left-to-right).

The default value for this property is false .

This property is added from API level 17.

android:taskAffinity
affinity names that are used by all activity in the application, except those that taskAffinity have other affinity set in their properties. For details, see the Affinity property of the Activity.

By default, all Activity in an application shares the same affinity. The name of the affinity is the same as the <manifest> package name set in the element.

android:testOnly
Indicates whether the application is intended for testing only. For example, this application may expose features or data that are not part of itself, which can lead to security breaches, but this is useful for testing purposes. This application can only be installed through ADB.
android:theme
A
reference to a style resource that defines the default theme (theme) for all Activity within the application. Each Activity can override the default theme with its own theme properties. For more information, see the styles and topics of the development Guide.
android:uiOptions
Additional options for use by the Activity UI.

Must be set to one of the following values.

value Description
"none" There are no additional UI options. This is the default value.
"splitActionBarWhenNarrow" When the horizontal space is limited (such as when the device is in portrait mode), a horizontal bar is added at the bottom of the screen to display ActionBar the Action item in. There is no longer a limited number of Action items displayed in the ActionBar at the top of the screen, ActionBar is split into the top navigation bar and the bottom horizontal bar. This ensures a reasonable amount of free space, not only to accommodate the Action item, but also to display navigation and caption at the top. menu items are not split into two parts, or they are displayed together.

For more information about ActionBar, see the Action Bar Development Guide.

This property is added from API level 14.

android:vmSafeMode
Indicates whether the application expects the virtual machine (VM) to run in Safe mode. The default value is " false ".
Introduced from:
API Level 1
See:
<activity> 
<service>
<receiver>
<provider>

Android Development-api Guide-<application>

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.