Android应用程序包含下面这几个部分:

程序的前后台:

  • Activities
  • Services
存储:
  • Content Providers
消息传递:
  • Intents
  • Broadcast Receivers
手机特性:
  • Widgets
  • Notifications

每个Android程序运行在单独的Dalvik虚拟机上,并且每个Android运行在不同的用户空间中,也就说,不同的android程序在linux中的用户空间是不同的。这样,android消息传递使用broadcast的方式应该就容易理解了。

Android Manifest

有过Web开发经验的程序员也许会对AndroidManifest.xml文件感到亲切,它很像web.xml,包含android程序中的方方面面。学造房子的时候,我们最好先学会看设计图。每一个android程序都有自己的AndroidManifest.xml,它主要包含:
  • android应用的结构信息

    • Activity,Service,Content Provider,Broadcast Receiver
    • Intent Filter
  • 元数据。
    • 版本号,图标,主题等

AndroidManifest.xml中的标签

  • uses-sdk:顾名思义

    • <uses-sdk android:minSdkVersion=”6” android:targetSdkVersion=”15”/>
  • uses-configuration:硬件的配置信息
    • <uses-configuration android:reqTouchScreen=”finger” android:reqNavigation=”trackball” android:reqHardKeyboard=”true” android:reqKeyboardType=”twelvekey”/>
  • uses-feature:程序运行所需要的硬件支持
  • supports-screens:顾名思义
    • <supports-screens android:smallScreens=”false”

      android:normalScreens=”true”

      android:largeScreens=”true”

      android:xlargeScreens=”true”

      android:requiresSmallestWidthDp=”480”

      android:compatibleWidthLimitDp=”600”

      android:largestWidthLimitDp=”720”/>
  • supports-gl-texture:声明这个应用程序是否能提供由一种GL压缩格式的asset
    • <supports-gl-texture android:name=”GL_OES_compressed_ETC1_RGB8_texture” />
  • uses-permission
    • <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION”/>
  • permission:用户自定义的permission
    • <permission android:name=”com.paad.DETONATE_DEVICE”

      android:protectionLevel=”dangerous”

      android:label=”Self Destruct”

      android:description=”@string/detonate_description”>

      </permission>
  • instrumentation:测试相关
    • <instrumentation android:label=”My Test”

      android:name=”.MyTestClass”

      android:targetPackage=”com.paad.apackage”>

      </instrumentation>
  • application:一个manifest文件中只能有一个application标签
    • <application android:icon=”@drawable/icon”

      android:logo=”@drawable/logo”

      android:theme=”@android:style/Theme.Light”

      android:name=”.MyApplicationClass”

      android:debuggable=”true”>

      [ ... application nodes ... ]

      </application>
    • 子标签:activity
      • <activity android:name=”.MyActivity” android:label=”@string/app_name”>

        <intent-filter>

        <action android:name=”android.intent.action.MAIN” />

        <category android:name=»android.intent.category.LAUNCHER» />

        </intent-filter>

        </activity>
    • 子标签:service
      • <service android:name=”.MyService”></service>
    • 子标签:provider
      • <provider android:name=”.MyContentProvider” android:authorities=”com.paad.myapp.MyContentProvider”/>
    • 子标签:receiver
      • <receiver android:name=”.MyIntentReceiver”>

        <intent-filter>

        <action android:name=”com.paad.mybroadcastaction” />

        </intent-filter>

        </receiver>
    • 子标签:uses-library
      • <uses-library android:name=”com.google.android.maps” android:required=”false”/>

Android 4学习(2):概述 - AndroidManifes.xml的更多相关文章

  1. Android开发学习---使用XmlPullParser解析xml文件

    Android中解析XML的方式主要有三种:sax,dom和pull关于其内容可参考:http://blog.csdn.net/liuhe688/article/details/6415593 本文将 ...

  2. Android UI学习组件概述

    Android的UI组件繁多,如果学习的时候不能自己总结和分类而是学一个记一个不去思考和学习他们内在的联系那真的是只有做Farmer的命了.为了向注定成为Farmer的命运抗争,在学习Android的 ...

  3. Android动画学习(二)——Tween Animation

    前两天写过一篇Android动画学习的概述,大致的划分了下Android Animation的主要分类,没有看过的同学请移步:Android动画学习(一)——Android动画系统框架简介.今天接着来 ...

  4. Android Animation学习(三) ApiDemos解析:XML动画文件的使用

    Android Animation学习(三) ApiDemos解析:XML动画文件的使用 可以用XML文件来定义Animation. 文件必须有一个唯一的根节点: <set>, <o ...

  5. 八、Android学习第七天——XML文件解析方法(转)

    (转自:http://wenku.baidu.com/view/af39b3164431b90d6c85c72f.html) 八.Android学习第七天——XML文件解析方法 XML文件:exten ...

  6. Android开发学习之路--网络编程之xml、json

    一般网络数据通过http来get,post,那么其中的数据不可能杂乱无章,比如我要post一段数据,肯定是要有一定的格式,协议的.常用的就是xml和json了.在此先要搭建个简单的服务器吧,首先呢下载 ...

  7. Android 4学习(3):概述 - Resources

    在应用程序中,处理与代码逻辑无关资源的最佳实践是将其放到程序的外部,典型的资源包括字符串,图片等.Android中的资源文件都在res文件夹中,这些资源包括字符串,颜色,主题,样式,图画,布局,动画, ...

  8. android菜鸟学习笔记3----关于AndroidMainfest.xml

    每个android项目都包含一个AndroidMainfest.xml文件,它包含了组成应用程序的每一个Acitivity.Service.Content Provider和Broadcast Rec ...

  9. Android:日常学习笔记(8)———探究UI开发(5)

    Android:日常学习笔记(8)———探究UI开发(5) ListView控件的使用 ListView概述 A view that shows items in a vertically scrol ...

随机推荐

  1. Codeforces Round #280 (Div. 2) D. Vanya and Computer Game 数学

    D. Vanya and Computer Game time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  2. vijos 1250 最勇敢的机器人 分组背包+并查集

    P1250最勇敢的机器人 背景 Wind设计了很多机器人.但是它们都认为自己是最强的,于是,一场比赛开始了~ 描述 机器人们都想知道谁是最勇敢的,于是它们比赛搬运一些物品. 它们到了一个仓库,里面有n ...

  3. JMeter接口测试报错,反馈和postman不一样(一)

    今天发现一个小的细节 同样一条请求,postman里面直接写就好 JMeter里面需要把编码加上 例如,同样一句话 postman里面这么写,返回值为 但是在JMeter里面这么写 显示结果为 在这里 ...

  4. CSDN_帖子__WapPc

    CSDN的帖子,Wap版 和 PC版 网址对应关系: 1. 举个例子: 手机版的网址: http://bbs.csdn.net/wap/topics/391891319 PC版的网址: http:// ...

  5. java: InputStreamReader将字节的输入流变成字符的输入流,OutputStreamWriter将字符的输出流变成字节的输出流

    InputStreamReader:将字节的输入流变成字符的输入流, OutputStreamWriter:将字符的输出流变成字节的输出流 //将缓冲区的内容读取,可以一次读取 //可以接收键盘的输入 ...

  6. Windows平台下Qt QOpenGL中glutSolidSphere()方法未定义的解决方法

    Windows平台下Qt中glut库的使用     用Qt中的QGLWidget窗体类中是不包括glut工具库的,难怪在myGLWidget(在我的程序中是QGLWidget的派生类)中绘制实心球体是 ...

  7. C语言基础一

    C语言学习 C语言的特点 语言简单.紧凑.使用方便.灵活 运算符丰富 数据类型丰富 具有结构化的控制语句 语法限制不太严格,程序设计自由度大 C语言允许直接访问物理地址,可以对硬件进行直接操作 生成代 ...

  8. python字典方法

    本文参考自<python基础教程 (第二版)> 操作 语法 举例 结果 建立字典 dict() 1.以关键字参数建立字典 2.以其他映射作为参数建立字典 1.d = dict(name=' ...

  9. ural 1039 树dp

    http://acm.timus.ru/problem.aspx?space=1&num=1039 1039. Anniversary Party Time limit: 0.5 second ...

  10. GitLab删除项目操作

    相关项目:Github删除项目 刚开始找了半天没找到删除按钮在哪,现在记录一下,分享. 第一步:点进入项目 第二步:进入项目Settings 第三步:往下拉,找到Remove,删除即可.