2014/5/20翻译

来源:互联网 发布:知我是个无法讨好的人 编辑:程序博客网 时间:2024/05/16 08:39

App Manifest

IN THIS DOCUMENT

  1. Structure of the Manifest File
  2. File Conventions
  3. File Features
    1. Intent Filters
    2. Icons and Labels
    3. Permissions
    4. Libraries

Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. The manifest file presents essential information about your app to the Android system, information the system must have before it can run any of the app's code. Among other things, the manifest does the following:

  • It names the Java package for the application. The package name serves as a unique identifier for the application.
  • It describes the components of the application — the activities, services, broadcast receivers, and content providers that the application is composed of. It names the classes that implement each of the components and publishes their capabilities (for example, which Intent messages they can handle). These declarations let the Android system know what the components are and under what conditions they can be launched.
  • It determines which processes will host application components.
  • It declares which permissions the application must have in order to access protected parts of the API and interact with other applications.
  • It also declares the permissions that others are required to have in order to interact with the application's components.
  • It lists the Instrumentation classes that provide profiling and other information as the application is running. These declarations are present in the manifest only while the application is being developed and tested; they're removed before the application is published.
  • It declares the minimum level of the Android API that the application requires.
  • It lists the libraries that the application must be linked against.

翻译:
每个应用程序都必须有一个AndroidManifest.xml文件在它的根目录下。清单文件呈现给Android系统关于应用程序的一些基本信息——系统必须具备才可以运行任何应用程序的代码。除其他事项外,该清单将执行以下操作:
它的名称为应用程序的Java包。该包名作为应用程序的唯一标识符。
它描述了该应用程序的组件—— 活动,服务,广播接收器,以及供应商提供的内容。它命名实现每个组件的类以及发布它们的功能(例如:他们可以处理的意图消息)。这些声明使Android系统知道是什么组件以及在什么条件下可以启动。
它决定哪些进程将承载应用程序组件。
它声明哪些权限的应用程序必须有以访问API的被保护部分和与其他应用程序进行交互。
它还宣称了别人都要求有以与应用程序的组件进行交互的权限。
它列出了正在运行的应用程序,提供分析和其他信息的仪器仪表类。这些声明只存在于清单中,而应用程序正在开发和测试;他们在发布应用程序之前就删除了。
它列出该应用程序必须链接的库。

0 0
原创粉丝点击