Getting Started with Android's zero-single-row development Diary (10)--android Application profile resolution

Source: Internet
Author: User

In the Android component-based application design architecture, a configuration file is an important element. It will apply the included components, the capabilities and configuration of each component, and the application environment to the various services of the Android framework layer, so that Android knows how to schedule individual components in the application. The Android configuration file is like a book directory that tells us what's inside.

first, permission settings

The app declares its required permissions through a configuration file to access restricted resources in its app or system. These permission claims inform the user when the app installs, and the user can decide whether or not to install the app, based on that information.

Add permissions, such as

    <!---    <android:name = " Android.permission.READ_CONTACTS "/>

If a developer needs to define permissions to restrict access to third-party apps, it can be defined through the <permission> configuration item, which was applied once in the last broadcast component, and I don't know if you remember.

  <  permission  android:name  = "Com.example.test"   = "Permission name"   Android: Description  = "Permission description"   Android: Permissiongroup  = "Android.permission-group.cost_money"   Android:protectionlevel  = "normal"    </ permission  >  

The defined permissions also need to be deployed to the corresponding component to take effect. When a Component object is constructed, the component management system verifies that the permission declaration of the requesting component matches the permission configuration of the component, and throws an exception to prevent the call if the match fails.

Second, the environment configuration

Each application has its own hardware and software environment on which it depends. Some application implementations rely on a specific version of the SDK, while others require some specific hardware support. The hardware and software information that the application relies on needs to be declared in the configuration file's environment configuration section.

Using configuration Items <uses-sdk>, you can declare the SDK version information that the app depends on. The <users-feature> configuration item is used to declare the peripherals that the app relies on or the featured features of Android. For example, an app that takes a photo feature needs to declare that the device you're installing has a camera

<android:name= "Android.hardware.camera"/>

Additionally, the,<uses-configuration> configuration item, which describes the input device configuration;<supports-screens> required by the app, declares the screen settings that the app depends on. These configuration items need to be declared for applications that have special requirements for input or display.

III. Application and Component Configuration

A central part of the configuration file is a description of the characteristics of the application and its components. Each component in the app will have its calling and running requirements, which need to be described in the configuration file to help the Android system service know how to dispatch these components. The configuration file describes the component, mainly including several aspects.

(1) Description of basic information
Each component will have some of the most basic configuration information, including the implementation class name of the component, name of the component name, label, icon, and so on.

(2) Interface description
The functionality of each component is described in the configuration file. The interface component, the service component, and the broadcast component are all configuration information for each component that is connected via Android's intent, and you can place several <intent-filter> items to express the intent objects that the component can handle.

(3) Operation model Description
By default, each component runs in the main thread of the application, and in some special cases, some components need to be executed in a particular process and can be set through the process item.

(4) Permission description
Set by the permission parameter of the component.

(5) Meta-Data description
Any key-value information is used to inform the system to attach some system functions to the component. For example, if you want to bind a specific search module to a component, you can configure it through <meta-data>.

(6) Description of availability
Some parameters are not available after the app is installed. This needs to be set through the Enable parameter in the component configuration. While some components can only be used by the application itself, it is necessary to set the exported parameter to False.

In addition, there is the <uses-library>, which declares an additional class library where the app needs to be linked.

Well, this is part of the component of the add-on bar, let everyone know how to register components and other information in the configuration file.

Reference article:androidmanifest.xml configuration file http://blog.chinaunix.net/uid-9185047-id-3460344.html

========================================

Cpacm

Address: http://www.cnblogs.com/cpacm/p/3935268.html

Getting Started with Android's zero-single-row development Diary (10)--android Application profile resolution

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.