Android Development-api Guide-<manifest>

Source: Internet
Author: User

<manifest>

English Original: http://developer.android.com/guide/topics/manifest/manifest-element.html
Acquisition (update) Date: 2014-5-30
Moved from the original blog: http://blog.sina.com.cn/s/blog_48d491300100zmum.html

Grammar:
<Manifestxmlns:android= "Http://schemas.android.com/apk/res/android" Package= "string"Android:shareduserid= "string"Android:shareduserlabel= "string resource"Android:versioncode= "integer"Android:versionname= "string"android:installlocation=["Auto"| "Internalonly" | "Preferexternal"]>    . . .</Manifest>
Included in:
No

Must contain:
<application>
can include:
<compatible-screens>
<instrumentation>
<permission>
<permission-group>
<permission-tree>
<supports-gl-texture>
<supports-screens>
<uses-configuration>
<uses-feature>
<uses-permission>
<uses-sdk>
Description
the root element of the Androidmanifest.xml file. Must contain <application> elements and settings xmlns:android and package properties.
Property:
xmlns:android
defines the Android namespace. You should ensure that the value of this property is " http://schemas.android.com/apk/res/android ".
package
Specifies the full package name of the Java language style for the application. The name must be unique. The name can contain uppercase and lowercase letters (' a ' to ' Z '), numbers, and underscore ('_'). However, each part of the package name can only start with a letter.

To avoid conflicts with other developers, you should use your own Internet domain name as the base part of the package name (reverse order). For example, the app that Google publishes com.google starts with. Never use as a namespace when you publish your app com.example .

The package name is used as the unique identifier for the application. It is also the default name for the application process (see <application> attributes of the element process ) and the Affinity name of the Activity default task (see <activity> attributes of the element taskAffinity ).

reminder: Once the application is published, the package name is not allowed to be changed. The package name defines the identity of the application, and if the package name is modified, it means that it becomes another application, and the old version of the user can no longer be updated.

android:sharedUserId
the Linux user ID to be shared with other applications. By default, Android assigns a unique user ID to each application. However, if you set this property of more than two applications to the same value, the programs will share the same id-and they will be signed with the same certificate. Multiple applications with the same user ID can access data to each other and can run in the same process if needed.
android:sharedUserLabel
The
text label of the shared user ID for the user to read. This property must be set to a reference to a string resource and cannot be set directly to a string.

This property has been introduced since API level 3. Takes effect only if the property is set at the same time sharedUserId .

android:versionCode
Build
number. This number is used only to determine the new and old extent of the version, and the larger the number represents the newer the version. This is not the version number shown to the user, which is set by the versionName property.

This property value must be set to an integer value, such as "100". You can set it to a value of any size, as long as the value of each subsequent version is larger than the previous one. For example, you can set the Bulid version number. Alternatively, you can convert the version number in the "x.y" format to an integer, and the "X" and "Y" respectively as low 16-bit and high-16-bit codes. Or you can simply add 1 to the new version each time you publish it.

android:versionName
The version number for the user to view. This property can be set directly to a string or set to a reference to a string resource. This string has no other meaning than to show the user view. versionCodeproperty to save the actual version number used internally.
android:installLocation
The default installation location for the application.

Accept only the following keywords:

value Description
"internalOnly" The application must be installed in the internal storage. If set to this value, the application will never be installed to the external storage. If the internal storage is full, the system cannot install the program. This is also android:installLocation the default setting when undefined.
"auto" Applications can be installed in external storage, but the default system is first installed in internal storage. If there is not enough internal storage space, the system will install it on the external storage. Once installed, the user can freely transfer the program to internal or external storage via the system settings.
"preferExternal" It is best to install the application to an external storage (SD card). The system is not guaranteed to succeed every time. If the external storage media is unavailable or has no space, the application may also be installed in the internal storage. Once installed, the user can freely transfer the program to internal or external storage via the system settings.

Note: By default, the application will be installed in the internal storage. It is auto preferExternal possible to install to external storage only if the attribute "" or "" is defined.

If the application is installed in external storage:

    • The .apk file is saved in the external storage, but the application's data (such as a database) is still stored in the device's internal storage.
    • The .apk save container for the file is encrypted with the key, allowing only the application to access it on the installation device. (Even if you switch the SD card to another device, the user is not able to use the application installed on the card.) However, multiple SD cards can be used on the same device.
    • The application can be moved to internal storage when the user needs it.

Users can also request the transfer of applications from internal storage to external storage. However, the default setting for this property is internalOnly that the system does not allow the user to transfer the application to external storage.

For more information about using this property, see Application installation location (including how to maintain backward compatibility).

Introduced from API level 8.

Introduced from:
are API level 1, except as specifically noted in the attribute description.
See:
<application>

Android Development-api Guide-<manifest>

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.