manifests节点
manifests节点用于显示Android应用程序的配置文件.通常情况下,每个Android应用程序必须包含一个AndroidManifest.xml文件,位于manifests节点下.它是整个Android应用的全局描述文件,在该文件内,需要表明应用的名称,使用的图标,Activity和Service等信息,否则程序不能正常启动.
AndroidManifest.xml文件的路径 : 项目名\app\build\intermediates\manifests\full\debug\AndroidManifest.xml;
或者:项目名\app\src\main\AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.administrator.engineeringtextone"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="27" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name="com.example.administrator.engineeringtextone.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
元素 | 说明 |
---|---|
manifest | 根节点,描述了package中所有的内容 |
xmlns:android | 包含命名空间的声明,其属性值为http://schemas.android.com/apk/res/android,表示Android中的各种标准属性在该xml文件中使用,它提供了大部分元素中的数据 |
package | 声明应用程序包 |
application | 包含package中application级别组件声明的根节点,一个manifest中可以包含零个或者一个该元素 |
Android:icon | 应用程序图标 |
android:lable | 应用程序的名称(标签) |
android:theme | 应用程序采用的主题,例如,Android Studio创建的项目默认采用@style/AppTheme |
activity | 与用户交互的主要工具,它是用户打开一个应用程序的初始页面 |
intent-filter | 配置Intent过滤器 |
action | 组件支持的Intent Action |
category | 组件支持的Intent Category,这里通常用来指定应用程序默认的启动的Activity |