Android Development _ talking about master configuration file (Androidmanifest.xml)

Source: Internet
Author: User

Androidmanifest.xml
Essence: Is the master configuration manifest file for the entire application
Include: The app's package name, version number, components, permissions, and other information
Role: Record the relevant configuration information for the application

First, the common label
(1), global article (package name, version information)
(2), component chapter (four components),
(3), permission chapter (Request permission and define permission)
1. Global article
(1), the application of the package name and version information management
Package= "Com.example.tset"
Android:versioncode= "1"
Android:versionname= "1.0" >
(2), control the Android version of the information (can support the minimum version, you expect the system version)
Android:minsdkversion= "8"
android:targetsdkversion= "16"
2. Component Chapter
<application android:icon= "@drawable/icon"
Android:theme= "@style/my_theme" >
</application>
Its properties can be set:
(1), Icon: Android:icon
(2), title: Android;label
(3), theme style: Android:theme

Registering components in a configuration file

(1), define activity

<activity
Android:name= "Com.example.allcode.MainActivity"
Android:label= "@string/app_name"
Android:theme= "@android: Style/theme.dialog"
>

<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>//as the main activity
<category android:name= "Android.intent.category.LAUNCHER"/>//displayed in the software list
</intent-filter>
</activity>
Note: Starting an activity that is not defined in the manifest throws an exception
(2), define Service (services)
<sevice android:name= "Com.ttg.service.CouponService"
<intent-filter>
<action android:name= "Com.ttg.service" </action>
</intent-filter>
</seivice>
(3), content Provider (contents provider)
<provider android:name= "Com.example.manifest.provider" >
</provider>
Content providers are used to manage database access and in-Program and inter-program sharing
(4), broadcast receiver (broadcast receiver)
<receiver android:name= "Com.ttg.receiver.CouponService"
<intent-filter>
<action android:name= "Com.ttg.install" </action>
</intent-filter>
</receiver>

Android Development _ talking about master configuration file (Androidmanifest.xml)

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.