您的位置:首页 > 移动开发 > Android开发

Android 学习:Manifest 文件--Android Manifest.xml

2015-04-01 10:40 645 查看
Android 应用程序由松散耦合的组件构成,并使用应用程序Manifest绑定在一起。应用程序Manifest描述了每一个组件和他们之间的交互方式。还用于指定应用程序元数据、其硬件和平台要求、外部库以及必须的权限。

Activity 应用程序的表示层。(每一个UI都是扩展自Activity类)。使用fragment和视图来布局和显示消息,以及响应用户动作。

Service ,没有UI,执行不需要交互的任务。

Content Provider,可共享的持久数据存储器。通常会与SQL数据库交互。

Intent,应用程序间的消息传递框架。可以用来启动和停止Activity和Service。

Broadcast Receiver , Intent侦听器。

Widget,添加到主屏幕的可视化应用程序组件。是Broadcast Receiver的特殊变体,可用于创建动态的交互式应用程序组件。

Notification,可向用户发送信号,同时不打断当前的Activity。

典型结构:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sh.tian.myfirstapp" >

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".ST1Activity"
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>


  

<uses-sdk android:minSdkVersion="6"

android:targetSdkVersion="15" />

指定SDK版本。

<uses-configuration> 指定输入设备组合。

<uses-feature/> 硬件设备功能。指定OpenGL最低版本

<support-screens/> 支持屏幕。

<uses-permission/>安全模型。

<instrumentation/>测试框架。

<application /> 一个Manifest只能包含一个application。使用各种属性指定应用程序的各种元数据(标题、图标和主题)。

<activity /> 每一个activity都要有一个activity标签。

<service /> 每一个service都要有一个service标签。

<provider />

<receiver />

<uses-library>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: