Skip to content

Commit 589c966

Browse files
committed
update
1 parent ecf7275 commit 589c966

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Android/四大组件/Service.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@ Service有两种方式开启,**startService** 和 **bindService** 区别在于
1212

1313
![](http://images.cnitblog.com/blog/325852/201303/24233205-ccefbc4a326048d79b111d05d1f8ff03.png)
1414

15-
IntentService:带有工作线程的service,原理基于HandlerThread
15+
**IntentService**:带有工作线程的service,原理基于HandlerThread
16+
17+
### 保活
18+
19+
- `onStartCommand`方法的返回值设置为START_STICKY,在意外停止后会被重启
20+
- 通过`startForeground`设置为前台进程,且常驻在通知栏
21+
- 通过多进程Service互相绑定守护
22+
- AlarmManager不断地唤醒
23+
- 监听锁屏、解锁,通过1像素的Activity维持前台进程
24+
- 联系厂商,加入白名单(;¬_¬)

Http/HTTP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Hyper Text Transfer Protocol,超文本传输协议,基于**TCP/IP**的一个
66

77
- 1.0:客户端每次与web服务器建立连接一次只能获取一个资源,每次都需要三次握手
88

9-
- 1.1:允许客户端和web服务器建立连接后获取多个资源,现在绝大多数都是用的此协议(默认Connection:Keep-Alive
9+
- 1.1:允许客户端和web服务器建立连接后获取多个资源(长连接),现在绝大多数都是用的此协议(默认Connection:Keep-Alive
1010

11-
- 2.0:压缩了HTTP协议的头信息,减少数据包的大小,多路复用机制,提高响应速度,允许通过单一的连接来发起多重的请求
11+
- 2.0:压缩了HTTP协议的头信息,减少数据包的大小,多路复用机制,提高响应速度,允许通过单一的连接来发起多重的请求,并且从1.x的基于文本格式的解析变成了二进制格式,提高了健壮性
1212

1313
### 访问过程
1414

0 commit comments

Comments
 (0)