- 授权协议: BSD
- 开发语言: Java
- 操作系统: Android
- 软件首页: https://github.com/BoltsFramework/Bolts-Android
- 软件文档: https://github.com/BoltsFramework/Bolts-Android/blob/master/README.md
- 官方下载: https://github.com/BoltsFramework/Bolts-Android/archive/master.zip
软件介绍
Bolts 是一款底层类库集合, 在后台实现异步操作, 并提供接口反馈当前异步执行的程度 (可以通过接口实现UI进度更新), 最后反馈执行的结果给UI主线程, 与AsyncTask比较: (1)使用的是无大小限制的线程池; (2)任务可组合可级联,防止了代码耦合。
使用
dependencies {
compile 'com.parse.bolts:bolts-tasks:1.4.0'
compile 'com.parse.bolts:bolts-applinks:1.4.0'}示例代码
/**
Gets a String asynchronously.
*/
public Task<String> getStringAsync() {
// Let's suppose getIntAsync() returns a Task<Integer>.
return getIntAsync().continueWith(
// This Continuation is a function which takes an Integer as input,
// and provides a String as output. It must take an Integer because
// that's what was returned from the previous Task.
new Continuation<Integer, String>() {
// The Task getIntAsync() returned is passed to "then" for convenience.
public String then(Task<Integer> task) throws Exception {
Integer number = task.getResult();
return String.format("%d", Locale.US, number);
}
}
);
}
罗辑思维:迷茫时代的明白人
罗振宇 / 北京联合出版公司 / 2015-9 / 42
编辑推荐 1、 罗振宇,自媒体视频脱口秀《罗辑思维》主讲人,互联网知识型社群试水者,资深媒体人和传播专家。曾任CCTV《经济与法》《对话》制片人等。2012年底打造知识型视频脱口秀《罗辑思维》。半年内,由一款互联网自媒体视频产品,逐渐延伸成长为全新的互联网社群品牌。 他对商业和互联网的独到见解,影响了互联网一代的知识结构和对互联网的认识:人类正在从工业化时代进入互联网时代。新的时代将彻......一起来看看 《罗辑思维:迷茫时代的明白人》 这本书的介绍吧!
