- 浏览: 1843506 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (665)
- 闲话 (17)
- ruby (1)
- javascript (40)
- linux (7)
- android (22)
- 开发过程 (11)
- 哥也读读源代码 (13)
- JVM (1)
- ant (2)
- Hibernate (3)
- jboss (3)
- web service (17)
- https (4)
- java基础 (17)
- spring (7)
- servlet (3)
- 杂记 (39)
- struts2 (10)
- logback (4)
- 多线程 (2)
- 系统诊断 (9)
- UI (4)
- json (2)
- Java EE (7)
- eclipse相关 (4)
- JMS (1)
- maven (19)
- 版本管理 (7)
- sso (1)
- ci (1)
- 设计 (18)
- 戒烟 (4)
- http (9)
- 计划 (4)
- HTML5 (3)
- chrome extensions (5)
- tomcat源码阅读 (4)
- httpd (5)
- MongoDB (3)
- node (2)
最新评论
-
levin_china:
勾选了,还是找不到
用spring annotation声明的bean,当打包在jar中时,无法被扫描到 -
GGGGeek:
我用的maven-3.5.0,还没有遇到这种情况,使用jar ...
用spring annotation声明的bean,当打包在jar中时,无法被扫描到 -
GGGGeek:
受益匪浅,从组织项目结构,到技术细节,讲的很到位,只是博主不再 ...
一个多maven项目聚合的实例 -
Aaron-Joe-William:
<?xml version="1.0" ...
hibernate逆向工程 -
li272355201:
http://archive.apache.org/dist/ ...
tomcat源码阅读(一)——环境搭建
一、Each Activity can make an Intent call to get something done without knowing exactly who’ll receive that Intent
Android的这种调用方式,是一种各组件之间低耦合的集成方式。比如自己的应用需要调用打电话的功能,可以创建一个Intent.setAction(DIAL),请求“某一个”电话程序来完成打电话功能。如果没有安装第三方的程序,那么通常手机自带的电话程序会响应这个请求,如果安装了第三方的拨号程序(当然这种情况很少),那么就会由第三方拨号程序完成通话。而原来的Activity,对这一切是一无所知的
二、用intent来描述意图,然后用intent-filter来进行全局匹配。如果找到唯一结果,就进行调用;如果找到多个结果,则要求用户选择;如果没有找到结果,则抛出异常。手机上安装的所有程序,无论是自带的,还是第三方应用,都会参与这个匹配过程。当然,如果在manifest.xml中没有设置intent-filter,就不会参与到intent匹配。这种情况下,这种组件就只能通过显式调用被调用到
三、
Action: Fully qualified String indicating the action (for example, android.intent.action.DIAL)
Category: Describes where and how the Intent can be used, such as from the main
Android menu or from the browser
Component: Specifies an explicit package and class to use for the Intent, instead of inferring from action, type, and categories
Data: Data to work with, expressed as a URI (for example, content://contacts/1)
Extras: Extra data to pass to the Intent in the form of a Bundle
Type: Specifies an explicit MIME type, such as text/plain or vnd.android.cursor.item/email_v2
四、implicit and explicit invocation。这个说的是隐式调用和显式调用
五、Android parses each <intent-filter> element into an IntentFilter object. After Android installs an .apk file, it registers the application’s components, including the Intent filters. When the platform has a registry of Intent filters, it can map any Intent requests to the correct, installed Activity, BroadcastReceiver, or Service
六、下面是intent-filter的匹配规则
Action: Each individual IntentFilter can specify zero or more actions and zero or more categories. If the action isn’t specified in the IntentFilter, it’ll match any Intent; otherwise, it’ll match only if the Intent has the same action
Category: An IntentFilter with no categories will match only an Intent with no categories; otherwise, an IntentFilter must have at least what the Intent specifies. For example,if an IntentFilter supports both the HOME and the ALTERNATIVE categories, it’ll match an Intent for either HOME or CATEGORY. But if the IntentFilter doesn’t provide any categories, it won’t match HOME or CATEGORY
Data: scheme://authority/path分别对应android:schema、android:host、android:path
七、A broadcast Intent doesn’t invoke an Activity, so your current screen usually remains in the foreground
八、Android best practices discourage long-running services. Services that run continually and constantly use the network or perform CPU-intensive tasks will eat up the device’s battery life and might slow down other operations
九、In Android, each application runs within its own process. Other applications can’t directly call methods on some service of another application, because the applications are in different sandboxes
十、If you want to allow other developers to use your weather features, you need to give them information about the methods you provide, but you might not want to share your application’s source code. Android lets you specify your IPC features by using an interface definition language (IDL) to create AIDL files
十一、Service lifecycle
SERVICE-STARTED LIFECYCLE: If you start a Service by calling Context.startService(), it runs in the background whether or not anything binds to it. If the service hasn’t been created, the Service onCreate() method is called. The onStart() method is called each time someone tries to start the service, whether or not it’s already running. Additional instances of the Service won’t be created. The Service will continue to run in the background until someone explicitly stops it with the Context.stopService() method or when the Service calls its own stopSelf() method. You should also keep in mind that the platform might kill services if resources are running low, so your application needs to be able to react accordingly
SERVICE-BOUND LIFECYCLE: If an Activity binds a Service by calling Context.bindService(), it’ll run as long
as the connection is open. An Activity establishes the connection using the Context and is also responsible for closing it. When a Service is only bound in this manner and not also started, its onCreate() method is invoked, but onStart() is not used. In these cases, the platform can stop and clean up the Service after it’s unbound
CLEANING UP WHEN A SERVICE STOPS: When a Service stops, its onDestroy() method is invoked. Inside onDestroy(), every Service should perform final cleanup, stopping any spawned threads, terminating network connections, stopping services it had started, and so on
Android的这种调用方式,是一种各组件之间低耦合的集成方式。比如自己的应用需要调用打电话的功能,可以创建一个Intent.setAction(DIAL),请求“某一个”电话程序来完成打电话功能。如果没有安装第三方的程序,那么通常手机自带的电话程序会响应这个请求,如果安装了第三方的拨号程序(当然这种情况很少),那么就会由第三方拨号程序完成通话。而原来的Activity,对这一切是一无所知的
二、用intent来描述意图,然后用intent-filter来进行全局匹配。如果找到唯一结果,就进行调用;如果找到多个结果,则要求用户选择;如果没有找到结果,则抛出异常。手机上安装的所有程序,无论是自带的,还是第三方应用,都会参与这个匹配过程。当然,如果在manifest.xml中没有设置intent-filter,就不会参与到intent匹配。这种情况下,这种组件就只能通过显式调用被调用到
三、
Action: Fully qualified String indicating the action (for example, android.intent.action.DIAL)
Category: Describes where and how the Intent can be used, such as from the main
Android menu or from the browser
Component: Specifies an explicit package and class to use for the Intent, instead of inferring from action, type, and categories
Data: Data to work with, expressed as a URI (for example, content://contacts/1)
Extras: Extra data to pass to the Intent in the form of a Bundle
Type: Specifies an explicit MIME type, such as text/plain or vnd.android.cursor.item/email_v2
四、implicit and explicit invocation。这个说的是隐式调用和显式调用
五、Android parses each <intent-filter> element into an IntentFilter object. After Android installs an .apk file, it registers the application’s components, including the Intent filters. When the platform has a registry of Intent filters, it can map any Intent requests to the correct, installed Activity, BroadcastReceiver, or Service
六、下面是intent-filter的匹配规则
Action: Each individual IntentFilter can specify zero or more actions and zero or more categories. If the action isn’t specified in the IntentFilter, it’ll match any Intent; otherwise, it’ll match only if the Intent has the same action
Category: An IntentFilter with no categories will match only an Intent with no categories; otherwise, an IntentFilter must have at least what the Intent specifies. For example,if an IntentFilter supports both the HOME and the ALTERNATIVE categories, it’ll match an Intent for either HOME or CATEGORY. But if the IntentFilter doesn’t provide any categories, it won’t match HOME or CATEGORY
Data: scheme://authority/path分别对应android:schema、android:host、android:path
七、A broadcast Intent doesn’t invoke an Activity, so your current screen usually remains in the foreground
八、Android best practices discourage long-running services. Services that run continually and constantly use the network or perform CPU-intensive tasks will eat up the device’s battery life and might slow down other operations
九、In Android, each application runs within its own process. Other applications can’t directly call methods on some service of another application, because the applications are in different sandboxes
十、If you want to allow other developers to use your weather features, you need to give them information about the methods you provide, but you might not want to share your application’s source code. Android lets you specify your IPC features by using an interface definition language (IDL) to create AIDL files
十一、Service lifecycle
SERVICE-STARTED LIFECYCLE: If you start a Service by calling Context.startService(), it runs in the background whether or not anything binds to it. If the service hasn’t been created, the Service onCreate() method is called. The onStart() method is called each time someone tries to start the service, whether or not it’s already running. Additional instances of the Service won’t be created. The Service will continue to run in the background until someone explicitly stops it with the Context.stopService() method or when the Service calls its own stopSelf() method. You should also keep in mind that the platform might kill services if resources are running low, so your application needs to be able to react accordingly
SERVICE-BOUND LIFECYCLE: If an Activity binds a Service by calling Context.bindService(), it’ll run as long
as the connection is open. An Activity establishes the connection using the Context and is also responsible for closing it. When a Service is only bound in this manner and not also started, its onCreate() method is invoked, but onStart() is not used. In these cases, the platform can stop and clean up the Service after it’s unbound
CLEANING UP WHEN A SERVICE STOPS: When a Service stops, its onDestroy() method is invoked. Inside onDestroy(), every Service should perform final cleanup, stopping any spawned threads, terminating network connections, stopping services it had started, and so on
发表评论
-
最近半个月开发小结
2011-12-05 22:16 13141、有一个方法,有一段 ... -
android培训文档提纲(四)
2011-11-27 23:28 12511、生命周期方法onSaveInstanceState()是在 ... -
Tasks and Back Stack
2011-11-22 23:47 1183Even though the activities may ... -
上周开发过程中几个简单问题的总结
2011-11-21 13:18 1363上周开发中组员遇到几个问题,都不是大问题,但都耽搁了一些时间。 ... -
android培训文档提纲(三)
2011-11-12 23:47 17661、Activity和Service组件是Context的子类 ... -
android的Log组件和logcat命令
2011-11-12 23:03 6326项目进入开发阶段了, ... -
android培训文档提纲(一)
2011-10-23 14:05 1607最近项目快要进入开发 ... -
顶部有一排按钮,最底下还有FooterView的ListView页面
2011-08-13 15:46 3302先上效果图: 下面详细说说这个页面是怎么做出来的: 1、 ... -
实现屏幕下方展示的TAB分页
2011-08-09 23:22 2177这篇博客是参考helloandroid兄的腾讯微博应用,我整理 ... -
PendingIntent
2011-08-08 16:02 1562在开发SMS等应用时,有时调用相关的API会要求提供一个类型为 ... -
android数据持久化总结
2011-08-06 12:23 19221、 通过Context.getSharedPreferenc ... -
intent and service
2011-08-04 00:07 1424明天才开始讨论包需求 ... -
最近两周android总结
2011-08-01 23:42 1617最近2周预研做得差不多 ... -
没有单元测试,怎能写代码
2011-07-25 17:56 1573项目前期的技术点预研完成了,最近开始做原型开发。 之前没有在 ... -
android process and thread
2011-07-18 16:31 1695前三周android预研中,把可能用到的技术点都识别了,并完成 ... -
android第三周小结
2011-07-18 10:16 13641. 系统自带的通讯录应用,联系人名单保存在data/data ... -
onPause()方法的特殊性
2011-07-15 17:11 2929onPause(), onStop(), onDestroy( ... -
activity存在的三种状态
2011-07-15 16:44 1776An activity can exist in essent ... -
android第二周小结
2011-07-14 10:50 11651. 做了短信侦听的Broadca ... -
android一周小结
2011-07-04 21:26 1232做了一周android预研,总结以下几条: 1. 用DDMS ...
相关推荐
"软件项目开发的全套文档提纲模板"旨在提供一个结构化的框架,帮助开发者和项目经理有效地组织和编写各种必要的文档。以下是对这个提纲模板中可能包含的主要知识点的详细解释: 1. **项目启动文档**: - 项目背景...
软件项目开发的全套文档提纲 软件项目开发的全套文档提纲\项目开发总结报告(GB8567——88).doc 软件项目开发的全套文档提纲\用户手册(GB8567——88).doc 软件项目开发的全套文档提纲\操作手册(GB8567——88)....
以下是对"软件项目开发的全套文档提纲"的详细解释: 1. **项目启动文档 (Project Initiation Document, PID)** - PID是项目的起点,它定义了项目的目标、范围、预期成果以及初步的时间线和预算。 2. **需求分析...
软件开发项目文档的应用是非常广泛的,例如,软件开发项目文档可以作为项目团队的参考文档,软件开发项目文档可以作为项目团队与客户之间的交流工具,软件开发项目文档可以作为项目团队的培训文档等。 软件开发项目...
这个提纲主要关注的是底层部分,特别是针对ARM平台的Android移植与驱动核心开发。 1. **Android系统体系及移植相关工具** - **Android操作系统体系结构**:Android的核心包括Linux内核,负责硬件管理,以及Dalvik...
"项目开发的全套文档提纲doc"涵盖了项目从启动到结束各个阶段所需的主要文档,旨在为团队提供清晰的指导和结构化的工作流程。以下是这套文档提纲中所包含的知识点详解: 1. 可行性研究报告:这是项目启动阶段的第一...
清华大学培训班培训提纲清华大学培训班培训提纲清华大学培训班培训提纲清华大学培训班培训提纲
《高管财务知识培训》提纲主要涵盖了财务报表的解读、财务指标分析以及绩效分析三个核心领域,旨在提升高级管理人员的财务理解和决策能力。 首先,提纲深入解析了资产负债表和利润表这两个关键财务报表。资产负债表...
"软件项目开发全套文档提纲"涵盖了软件工程中的各个重要阶段,旨在提供一个清晰、系统化的指导框架,以帮助团队成员理解项目的整体结构和各个阶段的目标。以下是对这套文档模板各部分的详细解释: 1. **项目启动...
垃圾分类培训提纲.doc