- 浏览: 1841401 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (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 13091、有一个方法,有一段 ... -
android培训文档提纲(四)
2011-11-27 23:28 12461、生命周期方法onSaveInstanceState()是在 ... -
Tasks and Back Stack
2011-11-22 23:47 1180Even though the activities may ... -
上周开发过程中几个简单问题的总结
2011-11-21 13:18 1358上周开发中组员遇到几个问题,都不是大问题,但都耽搁了一些时间。 ... -
android培训文档提纲(三)
2011-11-12 23:47 17631、Activity和Service组件是Context的子类 ... -
android的Log组件和logcat命令
2011-11-12 23:03 6318项目进入开发阶段了, ... -
android培训文档提纲(一)
2011-10-23 14:05 1604最近项目快要进入开发 ... -
顶部有一排按钮,最底下还有FooterView的ListView页面
2011-08-13 15:46 3298先上效果图: 下面详细说说这个页面是怎么做出来的: 1、 ... -
实现屏幕下方展示的TAB分页
2011-08-09 23:22 2174这篇博客是参考helloandroid兄的腾讯微博应用,我整理 ... -
PendingIntent
2011-08-08 16:02 1559在开发SMS等应用时,有时调用相关的API会要求提供一个类型为 ... -
android数据持久化总结
2011-08-06 12:23 19181、 通过Context.getSharedPreferenc ... -
intent and service
2011-08-04 00:07 1420明天才开始讨论包需求 ... -
最近两周android总结
2011-08-01 23:42 1612最近2周预研做得差不多 ... -
没有单元测试,怎能写代码
2011-07-25 17:56 1570项目前期的技术点预研完成了,最近开始做原型开发。 之前没有在 ... -
android process and thread
2011-07-18 16:31 1690前三周android预研中,把可能用到的技术点都识别了,并完成 ... -
android第三周小结
2011-07-18 10:16 13611. 系统自带的通讯录应用,联系人名单保存在data/data ... -
onPause()方法的特殊性
2011-07-15 17:11 2926onPause(), onStop(), onDestroy( ... -
activity存在的三种状态
2011-07-15 16:44 1773An activity can exist in essent ... -
android第二周小结
2011-07-14 10:50 11631. 做了短信侦听的Broadca ... -
android一周小结
2011-07-04 21:26 1229做了一周android预研,总结以下几条: 1. 用DDMS ...
相关推荐
- 乙方还需协助甲方进行项目规划,对甲方人员进行培训,并在项目完成后交付所有相关文档和源代码。 3. **技术要求**: - 系统架构:采用B/S的H5技术或IOS及Android原生结构,确保跨平台兼容性。 - 技术先进性、...
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
基于java的网吧管理系统答辩PPT.pptx
基于java的基于SSM架构的网上书城系统答辩PPT.pptx
tornado-6.1-cp37-cp37m-win32.whl
c语言气泡排序、插入排序、选择排序、快速排序、希尔排序、堆排序、合并排序_SortAlgorithm.zip
Keyboard Maestro 11.0.3_macwk.dmg
基于微信小程序的鲜花销售微信小程序答辩PPT.pptx
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
tornado-6.2b1-cp39-cp39-musllinux_1_1_x86_64.whl
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
tornado-6.1b2-cp38-cp38-manylinux2014_aarch64.whl
基于java的土家风景文化管理平台答辩PPT.pptx
jira安装包
基于java的机场网上订票系统答辩PPT.pptx
小区物业管理系统 SSM毕业设计 附带论文 启动教程:https://www.bilibili.com/video/BV1GK1iYyE2B
yolo算法-金属-纸张-硬纸板垃圾数据集-13409张图像带标签-金属-纸张-硬纸板-塑料-其他-烟蒂-食物-玻璃.zip;yolo算法-金属-纸张-硬纸板垃圾数据集-13409张图像带标签-金属-纸张-硬纸板-塑料-其他-烟蒂-食物-玻璃.zip;yolo算法-金属-纸张-硬纸板垃圾数据集-13409张图像带标签-金属-纸张-硬纸板-塑料-其他-烟蒂-食物-玻璃.zip
项目介绍: 系统模块主要包括;用户、考试信息、考场信息、试卷、试题、考试等管理功能 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse