当前位置:编程学习 > XML/UML >>

AndroidManifest.xml解析(较详细)

Android学习笔记 3(http://www.zzzyk.com/kf/201112/115568.html):AndroidManifest.xml - application 翻译中
<application>

syntax:语法:

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

contained in:隶属于:
    <manifest>

can contain:可以包含:
    <activity>
    <activity-alias>
    <service>
    <receiver>
    <provider>
    <uses-library>

description: 说明:
    The declaration of the application. This element contains subelements that declare each of the application's components and has attributes that can affect all the components. Many of these attributes (such as icon, label, permission, process, taskAffinity, and allowTaskReparenting) set default values for corresponding attributes of the component elements. Others (such as debuggable, enabled, description, and allowClearUserData) set values for the application as a whole and cannot be overridden by the components.
    应用程序的声明。本元素包含子元素,即每个应用程序组件的声明,而且应用程序的属性能够影响所有组件。许多这样的属性(比如图标,标签,许可,进程,taskAffinity,和allowTaskReparenting) 设置默认值给组件元素的对应属性。其他的(比如debuggable,enabled,description 和allowClearUserData)设置全局值给应用程序,并不会被组件覆盖。

attributes 属性:

    android:allowClearUserData
        Whether or not users are given the option to remove user data — "true" if they are, and "false" if not. If the value is "true", as it is by default, the application manager includes an option that allows users to clear the data.
        用户是否被给予移除用户数据的选择 — "true"表示有,"false"表示没有。如果值是"true",也是默认值,应用程序管理器包含一个选择允许用户清除数据。

    android:allowTaskReparenting
        Whether or not activities that the application defines can move from the task that started them to the task they have an affinity for when that task is next brought to the front — "true" if they can move, and "false" if they must remain with the task where they started. The default value is "false".
        应用程序里定义的activity是否,在与它有affinity的task被带到前台时能够从启动时的task移动过去 — "true" 表示可以,"false"表示它必须留在启动它们的task里。默认值是"false"。

        The <activity> element has its own allowTaskReparenting attribute that can override the value set here. See that attribute for more information.
        <activity>元素有它自己的allowTaskReparenting属性可以覆盖这儿设置的值。更多信息,请参照那个属性。
    android:debuggable
        Whether or not the application can be debugged, even when running on a device in user mode — "true" if it can be, and "false" if not. The default value is "false".
        应用程序是否可以被调试,即使在它运行在一个用户模式的设备上 — "true"表示可以,"false"表示不可以。默认值为"false"。

    android:description
        User-readable text about the application, longer and more descriptive than the application label. The value must be set as a reference to a string resource. Unlike the label, it cannot be a raw string. There is no default value.
        用户可读的关于应用程序的描述,比应用程序标签更长更具描述性。该值必须是一个字符串资源的参照。不像标签,它不能是原始字符串。它没有默认值。

    android:enabled
        Whether or not the Android system can instantiate components of the application — "true" if it can, and "false" if not. If the value is "true", each component's enabled attribute determines whether that component is enabled or not. If the value is "false", it overrides the component-specific values; all components are disabled.
        Android系统是否能够实例化该应用程序的组件 — "true"表示可以,"false" 表示不可以。如果值是"true",每个组件的enabled属性决定那个组件是否可以被 enabled。如果值是"false",它覆盖组件指定的值;所有组件都是disabled。

        The default value is "true".
        默认值是"true"。
    android:hasCode
        Whether or not the application contains any code — "true" if it does, and "false" if not. When the value is "false", the system does not try to load any application code when launching components. The default value is "true".
        应用程序是否含有任何code — "true"表示有,"false"表示没有。当值是"false",当载入组件时,系统不会试图载入任何应用程序code。默认值是"true"。

      &nbs

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,