Manifest 文件 详解


本文地址:http://blog.csdn.net/caroline_wendy/article/details/20899281


Manifest可以定义应用程序及其组件需求的结构和元数组.

Android的文档:http://developer.android.com/guide/topics/manifest/manifest-element.html

Hello_World, AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="mzx.spike.hello_world.app" >      <application         android:allowBackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name"         android:theme="@style/AppTheme" >         <activity             android:name="mzx.spike.hello_world.app.MainActivity"             android:label="@string/app_name" >             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>  </manifest> 

xmlns:xml namespace的简写, android的命名空间;

package: 程序使用的包的名称;

application: manifest必须包含(must contain)的结点, 使用各种属性来指定应用程序的各种元数据;

activity: application的可选标签, 声明一个活动(Activity的子类), 实现应用程序得视觉用户接口(visual user interface)的部分功能;

intent-filter: 目的过滤器, 启动该activity的Intent(目的);

action:intent-filter的必选(must contain)标签, 目的过滤器的活动;

category: intent-filter的可选(can contain)标签, 目的过滤器的种类;


其中action和category里面, name属性的意思, 在Intent文档里面有标注;

文档:http://developer.android.com/reference/android/content/Intent.html


Manifest还可以使用Android Manifest Editor(Eclipse)进行管理XML, 界面化管理;

在Android Studio暂时没有此类功能;



更多相关文章

  1. Android核心分析(21)----Android应用框架之AndroidApplication
  2. 关于Android(安卓)Studio3.2新建项目Android(安卓)resource link
  3. Android(安卓)- Manifest 文件 详解
  4. Android之应用程序基础
  5. Android四大组件的理解
  6. Android官方入门文档[1]创建一个Android项目
  7. 第三章 Android程序设计基础
  8. Android(安卓)任务和回退堆栈---启动任务
  9. Android(安卓)Studio 3.0开始android Device Monitor弃用

随机推荐

  1. Android(安卓)3D 编程:索引
  2. Android中图片压缩分析(下)
  3. 如何调试跟踪Android源代码
  4. Android常用布局:线性布局和相对布局
  5. 初涉Android蓝牙开发
  6. Android百度地图(一):百度地图定位sdk 类
  7. android task与back stack 开发文档翻译
  8. 说不懂Android系统构架,太亏了!
  9. Android(安卓)imageView图片按比例缩放
  10. Android(安卓)GWES之Android窗口管理