简介 wanandroid项目基于 Retrofit + RxJava2.0 + Kotlin + MVP 用到的依赖 implementation 'io.reactivex.rxjava2:rxjava:2.1.3' implementation 'com.squareup.retrofit2:retrofit:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'com.squ…
推荐阅读,猛戳: 1.Android MVP 实例 2.Android Retrofit 2.0使用 3.RxJava 4.RxBus 5.Android MVP+Retrofit+RxJava实践小结 之前分享的Android Retrofit 2.0 使用,属于基本的使用,实际开发还远远不够,因此对其补充,主要在Retrofit配置和接口参数. Retrofit配置 添加依赖 app/build.gradle compile 'com.squareup.retrofit2:retrofit:…
实例带你了解Retrofit 2.0的使用,分享目前开发Retrofit遇到的坑和心得. 添加依赖 app/build.gradle 1 compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3' 接口调用 1 2 3 4 5 6 Retrofit retrofit = new Retrofit.Builder() //这里建议:- Base URL: 总是以/结尾:- @Url: 不要以/开头 .baseUrl("http://www.weath…
Android Retrofit 实现(图文上传)文字(参数)和多张图片一起上传 使用Retrofit进行文件上传,肯定离不开Part & PartMap. public interface FileUploadService { @Multipart @POST("upload") Call<ResponseBody> upload(@Part("description") RequestBody description, @Part Mult…
网络请求有个问题就是取消操作. 在Rxjava1中,调用subscribe之后会返回Subscription,然后利用CompositeSubscription进行统一管理. 在Rxjava2中,调用subscribe之后,返回的则是Disposable,Disposable同样用CompositeDisposable进行统一管理. 在Rxjava1中,我们继承Subscriber,可以这么写. class MySubscriber<T> extends Subscriber<T>…
链接:https://blog.csdn.net/carson_ho/article/details/73732076…
前言 文本已经收录到我的Github个人博客,欢迎大佬们光临寒舍:我的GIthub博客 看完本篇文章的,可以看下带你封装自己的MVP+Retrofit+RxJava2框架(二),里面封装得到了改进 本篇文章需要已经具备的知识: MVP的概念和基本使用 Retrofit框架的基本使用 RxJava2框架的基本使用 ButterKnife框架的基本使用 Base基类的概念 学习清单: Activity和Fragment基类的封装 MVP的封装使用 一.为什么要封装这套框架呢? 在搞清楚这个问题之前,…
Android使用RxJava+Retrofit2+Okhttp+MVP练习的APP 项目截图     这是我的目录结构 五步使用RxJava+Retrofit2+Okhttp+RxCache 第一步:导包 compile 'io.reactivex:rxjava:1.1.8' compile 'io.reactivex:rxandroid:1.2.1' compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4' compile 'com.squa…
Android Studio 3.0 更新了gradle后,项目竟然开始报错unable to resolve dependency for cordovalib...打开build.gradle看了后其中dependencies是这样写的 dependencies { compile fileTree(dir: 'libs', include: '*.jar') // SUB-PROJECT DEPENDENCIES START debugCompile(project(path: "Cord…
ReadHub项目Kotlin版转换指南(一.环境搭建) ReadHub项目Kotlin版转换指南(二.数据库和网络请求) ReadHub项目Kotlin版转换指南(三.MVP架构) Android 开发中的 MVP 架构相信大家都已经熟悉,不熟悉的请右转 Google,ReadHub 项目从 Java 转换成 Kotlin 过程中,我们需要一套新的架构方式来实现(Kotlin 项目中没有使用 dagger2). base 为 MVP 架构的基础部分,user 为其具体使用过程. base Ba…