177

Kotlin结合Rxjava和Retrofit做到极简网络请求 - 简书

 6 years ago
source link: http://www.jianshu.com/p/a41ac40733c5
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 由于当前正在写的项目集成了两个网络请求框架(Volley and Retrofit)对比之下也是选择了Retrofit。既然选择那自然要让自己以后开发更加省力(就是懒)。于是我在Retrofit中加入了Rxjava,这也是当下蛮流行的一个请求框架。然后又利用了Kotlin的一些新特性,使网络请求变得特别简单,代码量特别少。 正文 导包 首先需要导入相关的包,包括Rxjava(我这里使用...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK