![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android之Kotlin
wanxiaofan
看着你快乐的讲述你的故事,我替你陷入了深深的思考!
展开
-
Android 之Kotlin使用Retrofit和RxJava实现网络请求
一、实现原理 使用Retrofit实现网络请求,在通过Rxjava2实现线程调度,通过Gson得到当前的需要的模型类 二、实现过程 1、添加依赖 implementation 'com.squareup.okhttp3:okhttp:3.12.3' // OkHttp3 implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' // 日志 implementation 'com.squareup...原创 2020-06-05 14:55:07 · 768 阅读 · 0 评论 -
Android 之Kotlin封装Okhttp3和gson实现网络请求和下载
一、首先添加项目的Kotlin支持,这个不概述了,网上很多我主要就是讲述我怎么写的Kotlin网络请求 二、使用的开源项目 implementation 'com.squareup.okhttp3:okhttp:3.14.2' implementation 'com.google.code.gson:gson:2.8.5' 其次还得加上 compileOptions { ...原创 2019-07-01 15:24:05 · 4870 阅读 · 0 评论