Android SDK instance code analysis-accelerometer play (2)

Source: Internet
Author: User

Ii. configuration file description

<? XML version ="1.0"Encoding ="UTF-8"?>

<Manifest xmlns: Android = http://schemas.android.com/apk/res/android
Android: versioncode ="1"

Android: versionname ="1.0"

Package ="Com. example. Android. accelerometerplay">

<Application Android: icon ="@ Drawable/icon"Android: Label ="@ String/app_name">

<Activity Android: Name =". Accelerometerplayactivity"

Android: Label ="@ String/app_name"

Android: screenorientation ="Portrait"Android: theme ="@ Android: style/theme. notitlebar. fullscreen">

<Intent-filter>

<Action Android: Name ="Android. Intent. Action. Main"/>

<Category Android: Name ="Android. Intent. Category. launcher"/>

</Intent-filter>

</Activity>

</Application>

<Uses-SDK Android: minsdkversion ="5"> </Uses-SDK>

<Uses-Permission Android: Name ="Android. Permission. Vibrate"> </Uses-Permission>

<Uses-Permission Android: Name ="Android. Permission. wake_lock"> </Uses-Permission>

</Manifest>

<Manifest>The element is the root element of the androidmanifest. xml file. The following describes each attribute used:

Xmlns: Android: defines the namespace for Android, which should always be set to http://schemas.android.com/apk/res/android

Android: versioncode: an internal version number of the application, which is not displayed to the user.

Android: versionname: version number of the application displayed to the user

Package: Full Java package name of the application

<Application>An element is used to declare an application. It has attributes that affect all components in the application. The following describes attributes used in this application:

Android: icon: the icon of the entire application, which is displayed in the starter. It is defined in the resource that can be traced, for example, @ drawable/icon. It does not have a default icon.

Android: Label: the label of the entire application that the user can read. It is displayed under the application icon. Defined in string resource.

<Activity>The element declares the visible user interface in the application. Each activity object in the application corresponds to an <activity> element in this list file. The attributes of the element used in this application are described as follows:

Android: Name: Specifies the name of the implementation class of the activity. The ". Class Name" format is used. The package name uses the value defined in the package attribute of the <manifest> element.

Android: Label: This attribute specifies the user-visible label of this activity. When this activity is displayed, this label will be displayed on the screen. In this example, the name of the application is always set.

Android: screenorientation: This attribute sets the orientation of the activity on the screen of the device. In this example, it is set to portrait.

Android: Theme: set the theme style of the activity. In this example, the theme style is set to no title bar.

<Intent-filter>Child element that specifies the intent object type that the activity, service, and broadcast Explorer components can respond to. In this example, the following two child elements are contained:

<Action>Child element: A <intent-filter> element must contain one or more <action> elements. If it does not exist, it will not accept requests from any intent object. In this example, the android. Intent. Action. Main Value is specified for the Android: Name attribute, indicating that this activity is the application entry.

<Category>Child element: This element adds a category to the <intent-filter> element. In this example, the android. Intent. Category. launcher value is specified for the Android: Name attribute, indicating that the application will be placed in the app launcher of the Android system.

<Uses-SDK>Element: Specifies the android API level on which the application depends.

<Uses-Permission>Element: you have applied for the following permissions for correct operations:

Android. Permission. vibrate: apply for the right to use the Vibration Sensor

Android. Permission. wake_lock: apply for the permission to wake up the lock

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.