Androidmanifest.xml Introduction

Source: Internet
Author: User

This file is set in every Android program and is located in the root directory of the entire project, describing the components exposed in the package (Activity,service ...), the respective implementation classes, the various data that can be processed, and the location of the boot.

In addition to being able to declare four components, programmers often need to set important user permissions.

1 <?XML version= "1.0" encoding= "Utf-8"?>2 <!-- 3 Package: Represents the name of the application4 Android:versioncode or Android:versionname: Indicates that the project generated the APK version number, initially 1. When the APK has been updated,5 This version number can be modified to prompt the user to update6 android:installlocation= "Auto": Automatically find the installation location of the APK (mobile ROM or sdcard), or "preferexternal" will be considered on the SDcard first7   -8 <Manifestxmlns:android= "Http://schemas.android.com/apk/res/android"9  Package= "Com.study"Ten Android:versioncode= "1" One Android:versionname= "1.0"> A  -     <USES-SDK -         android:minsdkversion= "+" the android:targetsdkversion= "+" /> -  -     <Application -         Android:allowbackup= "true" + Android:icon= "@drawable/ic_launcher" - Android:label= "@string/app_name" + Android:theme= "@style/apptheme" > A         <!-- at android:icon= "@drawable/ic_launcher": Take the R.drawable.ic_launcher as the address, taken from the drawable picture, as the icon - android:label= "@string/app_name": Using R.string.app_name as the address, taken from the app_name of Strings.xml, as the application name -           - -          -         <Activity -             Android:name=". Mainactivity " in Android:label= "@string/app_name" > -              <!-- to android:name= ". Mainactivity ": Represents the entire project's main program (Mainacitivity.java), which is represented under the current package + android:label= "@string/app_name": Using R.string.app_name as the address, taken from the app_name of Strings.xml, as the application name -               - the             <Intent-filter> *                 <ActionAndroid:name= "Android.intent.action.MAIN" /> $ Panax Notoginseng                 <categoryAndroid:name= "Android.intent.category.LAUNCHER" /> -             </Intent-filter> the             <!-- + Intent-filter: A very important tag (intent filter) to filter some of the user's actions and actions A Android.intent.action.MAIN: Indicates that the current program is the entrance to the entire project the               - +         </Activity> -     </Application> $     <!-- $ There is also one of the most important uses-permission tags for setting network access permissions and more . -       - - </Manifest>

The newly created component must declare its android:name in this file to be used, and the generic name is the Java file name under the package. e.g., android:name= ". Otheractivity "

Androidmanifest.xml Introduction

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.