All Projects → getActivity → Easyhttp

getActivity / Easyhttp

Licence: apache-2.0
Android 网络请求框架,简单易用,so easy

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Easyhttp

Retrofiturlmanager
🔮 Let Retrofit support multiple baseUrl and can be change the baseUrl at runtime (以最简洁的 Api 让 Retrofit 同时支持多个 BaseUrl 以及动态改变 BaseUrl).
Stars: ✭ 1,961 (+363.59%)
Mutual labels:  okhttp, retrofit, retrofit2
Easygank
💊 The project build framework based on the Rx series and MVP pattern.
Stars: ✭ 750 (+77.3%)
Mutual labels:  gson, okhttp, retrofit
Mvvmhabit
goldze: 本人喜欢尝试新的技术,以后发现有好用的东西,我将会在企业项目中实战,没有问题了就会把它引入到MVVMHabit中,一直维护着这套框架,谢谢各位朋友的支持。如果觉得这套框架不错的话,麻烦点个 star,你的支持则是我前进的动力!
Stars: ✭ 6,789 (+1504.96%)
Mutual labels:  okhttp, retrofit, retrofit2
Mvpframes
整合大量主流开源项目并且可高度配置化的 Android MVP 快速集成框架,支持 AndroidX
Stars: ✭ 100 (-76.36%)
Mutual labels:  gson, okhttp, retrofit2
RxHttp
基于RxJava2+Retrofit+OkHttp4.x封装的网络请求类库,亮点多多,完美兼容MVVM(ViewModel,LiveData),天生支持网络请求和生命周期绑定,天生支持多BaseUrl,支持文件上传下载进度监听,支持断点下载,支持Glide和网络请求公用一个OkHttpClient⭐⭐⭐
Stars: ✭ 25 (-94.09%)
Mutual labels:  retrofit, okhttp, retrofit2
Rx Mvp
RxJava2+Retrofit2+RxLifecycle2+OkHttp3 封装RHttp 使用MVP模式构建项目
Stars: ✭ 343 (-18.91%)
Mutual labels:  download, okhttp, retrofit2
Easygo
基于Kotlin、OkHttp的声明式网络框架,像写HTML界面一样写网络调用代码
Stars: ✭ 40 (-90.54%)
Mutual labels:  download, okhttp, retrofit
WanAndroid
wanandroid的Kotlin版,采用Android X
Stars: ✭ 20 (-95.27%)
Mutual labels:  retrofit, okhttp, retrofit2
Kriptofolio
Free open source minimalistic cryptocurrencies portfolio app for Android.
Stars: ✭ 79 (-81.32%)
Mutual labels:  retrofit, gson, okhttp
RetrofitHelper
💪 RetrofitHelper是一个支持配置多个BaseUrl,支持动态改变BaseUrl,动态配置超时时长的Retrofit帮助类
Stars: ✭ 15 (-96.45%)
Mutual labels:  retrofit, okhttp, retrofit2
SunnyBeach
阳光沙滩APP
Stars: ✭ 60 (-85.82%)
Mutual labels:  gson, okhttp, retrofit2
Retrofit2Rxjava2Download
这是用Retrofit2和Rxjava2搭配封装的下载文件。
Stars: ✭ 19 (-95.51%)
Mutual labels:  download, retrofit2
Dowy
🎬Application that displays a list of Movies and Tv Series using Modern Android Application Development tools and API's
Stars: ✭ 29 (-93.14%)
Mutual labels:  gson, retrofit2
gv4j
Unofficial Google Voice API for Java.
Stars: ✭ 18 (-95.74%)
Mutual labels:  retrofit, okhttp
Mvvmsmart
基于谷歌最新AAC架构,MVVM设计模式的一套快速开发库,整合ViewModel+Lifecycles+Navigation+DataBinding+LiveData+Okhttp+Retrofit+RxJava+Glide等主流模块,满足日常开发需求。使用该框架可以快速开发高质量、易维护的Android应用。 项目组会持续维护,请放心使用.欢迎Start并Fork交流.
Stars: ✭ 382 (-9.69%)
Mutual labels:  okhttp, retrofit2
Compose-BreakingBad
🧪 ☠︎ Jetpack Compose - Breaking Bad ☢︎
Stars: ✭ 26 (-93.85%)
Mutual labels:  gson, retrofit2
EasyRetro
An Easy to use retrofit based network/api call extention for android
Stars: ✭ 16 (-96.22%)
Mutual labels:  retrofit, retrofit2
tuya-connector
tuya-connector helps you efficiently create cloud development projects regarding the OpenAPI or message subscription capabilities. You can put all the focus on business logic without taking care of server-side programming nor relational databases.
Stars: ✭ 28 (-93.38%)
Mutual labels:  retrofit, retrofit2
AndroidGo
Android、Flutter 开发者帮助 APP。包含事件分发、性能分析、Google Jetpack组件、OkHttp、RxJava、Retrofit、Volley、Canvas绘制以及优秀博文代码案例等内容,帮助开发者快速上手!
Stars: ✭ 30 (-92.91%)
Mutual labels:  retrofit, okhttp
Retrofit2demo
Stars: ✭ 378 (-10.64%)
Mutual labels:  gson, retrofit2

简单易用的网络框架

Gradle 集成

android {
    // 支持 JDK 1.8
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    // 网络请求框架:https://github.com/getActivity/EasyHttp
    implementation 'com.hjq:http:9.0'
    // OkHttp 框架:https://github.com/square/okhttp
    // noinspection GradleDependency
    implementation 'com.squareup.okhttp3:okhttp:3.12.12'
}

框架的具体用法请点击这里查看

不同网络请求框架之间的对比

功能或细节 EasyHttp Retrofit OkGo
对应版本 9.0 2.9.0 3.0.4
aar 包大小 61 KB 123 KB 131 KB
minSdk 要求 API 14+ API 21+ API 14+
配置多域名 支持 不支持 支持
动态 Host 支持 不支持 不支持
全局参数 支持 不支持 支持
超时重试 支持 不支持 支持
下载校验 支持 不支持 不支持
极速下载 支持 不支持 不支持
上传文件类型 File / InputStream / RequestBody RequestBody File
批量上传文件 支持 不支持 支持
上传进度监听 支持 不支持 支持
Json 参数提交 支持 不支持 支持
请求代码定位 支持 不支持 不支持
请求生命周期 自动管控 需要封装 需要封装
参数传值方式 字段名 + 字段值 参数名 + 参数值 定义 Key + Value
参数灵活性 不强制传入 强制全部传入 不强制传入
框架学习成本
API 记忆成本
接口维护成本
框架维护状态 维护中 维护中 停止维护
  • Retrofit 在我看来并不是那么好用,因为很多常用的功能实现起来比较麻烦,动态 Host 要写拦截器,日志打印要写拦截器,就连最常用的添加全局参数也要写拦截器,一个拦截器意味着要写很多代码,如果写得不够严谨还有可能出现 Bug,从而影响整个 OkHttp 请求流程,我经常在想这些功能能不能都用一句代码搞定,因为我觉得这些功能是设计框架的时候本应该考虑的,这便是我做这个框架的初心。

  • 本框架采用了 OOP 思想,一个请求代表一个对象,通过类的继承和实现的特性来实现接口的动态化配置,几乎涵盖接口开发中所有的功能,使用起来非常简单灵活。

  • 有很多人觉得写一个接口类很麻烦,这个点确实有点麻烦,但是这块的付出是有收获的,从前期开发的效率考虑:OkGo > EasyHttp > Retrofit,但是从后期维护的效率考虑:EasyHttp > Retrofit > OkGo,之所以比较这三个框架,是因为框架的设计思想不同,但是我始终认为 EasyHttp 才是最好的设计,所以我创造了它。

  • 前期开发和后期维护哪个更重要?我觉得都重要,但是如果两者之间存在利益冲突,我会毫不犹豫地选择后期维护,因为前期开发占据的是小头,后期的持续维护才是大头。

极速下载功能介绍

  • 其实本质上面和极速秒传的原理是差不多的,只不过一个是上传,另一个是下载。而极速上传是将本地文件的 MD5 值和服务器上面的进行比对,如果服务器存在这个 MD5 值的文件,就将这份文件映射一份到这个用户的网盘上面,从而达到了极速秒传的效果。而极速下载也是同理,根据后台给的文件 MD5 值和本地文件进行对比,如果存在这个文件并且 MD5 值一致,证明这个文件和服务器上面的文件是一致的,那么就直接跳过下载,直接回调下载成功监听。

  • 极速秒传和极速下载两者相同的共同点就是,利用缓存来达到极速的效果,只不过一者通过的是服务器的缓存,另一者使用的是本地的缓存,这两者都有一个共同的特点,就是减少服务器的压力,节省用户的等待时间。

代码定位功能介绍

  • 框架会在日志打印中输出在网络请求的代码位置,这样开发者可以直接通过点击 Log 来定位代码是在哪个类哪行代码,这样可以极大提升我们排查问题的效率,特别是在请求一多且业务复杂的情况下,我相信没有一个人会拒绝这样的功能。

作者的其他开源项目

Android技术讨论Q群:78797078

如果您觉得我的开源库帮你节省了大量的开发时间,请扫描下方的二维码随意打赏,要是能打赏个 10.24 🐵就太👍了。您的支持将鼓励我继续创作

点击查看捐赠列表

特别感谢

张鸿洋

WanAndroid

License

Copyright 2019 Huang JinQun

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].