Coder Social home page Coder Social logo

tianyahelp / net-okhttp3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liangjingkanji/net-okhttp3

0.0 0.0 0.0 13.6 MB

本仓库仅为Net支持 Android 5 (API level 21) 以下, 点击以下链接访问主仓库

Home Page: https://github.com/liangjingkanji/Net

License: Apache License 2.0

Java 16.06% Kotlin 83.94%

net-okhttp3's Introduction

不仅仅是网络请求的异步任务库

使用文档 | 无法访问? | 下载体验


Android上可能是最强的网络框架, 基于OkHttp/协程的非侵入式框架(不影响原有功能). 一行代码发起网络请求, 你甚至无需初始化

欢迎将本项目文档/注释进行国际化翻译, 感谢您的支持!
Welcome to international translation of this project's documents/notes, thank you for your support!

Net 1.x 版本使用RxJava实现
Net 2.x 版本使用协程实现
Net 3.x 版本使用OkHttp+协程实现, 可指定其OkHttp版本


欢迎贡献代码/问题

特点

  • 开发速度No.1
  • 专为Android而生
  • 支持OkHttp所有功能/组件
  • DSL编程用法
  • 高质量源码/注释/文档/示例

主要功能

  • 协程并发(不会协程也可上手)
  • 并发/串行/队列/同步请求
  • 快速切换线程
  • 全局错误处理
  • 协程作用域支持错误和结束回调
  • 解析任何数据(json/protocol...)的转换器
  • 泛型指定网络请求返回任何类型
  • 自动处理下拉刷新和上拉加载
  • 自动处理分页加载
  • 自动缺省页
  • 自动处理生命周期
  • 自动处理加载对话框
  • 自动错误信息吐司
  • 自动异常捕获(定位请求位置)
  • 支持ViewModel
  • Request携带数据(setExtra/tagOf)
  • Request支持Id/Group分组
  • AS日志插件/应用通知栏日志
  • 并发请求返回最快请求结果
  • 全局取消请求/自动取消请求
  • Https快速配置
  • Cookie持久化管理
  • 强制缓存模式/自定义缓存Key/缓存有效期/LRU缓存算法/缓存任何数据
  • 缓存+网络双重读取(预览模式实现)
  • 内置超强轮询器(计时器)
  • 监听上传/下载进度(使用时间, 每秒速度, 剩余时间...)

安装

如果你是在 Android 5 (API level 21) 以上开发建议使用最新版本: Net, 本仓库属于其兼容库

添加远程仓库根据创建项目的 Android Studio 版本有所不同

Android Studio Arctic Fox以下创建的项目 在项目根目录的 build.gradle 添加仓库

allprojects {
    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }
}

Android Studio Arctic Fox以上创建的项目 在项目根目录的 settings.gradle 添加仓库

dependencyResolutionManagement {
    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }
}

然后在 module 的 build.gradle 添加依赖框架

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0" // 协程(版本自定)
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'
// 介于okhttp 3.12.x的更新情况,Net-okhttp3已内置okhttp3:3.12.13,无需再单独引入。
implementation 'com.github.liangjingkanji:Net-okhttp3:3.4.12'

// 支持自动下拉刷新和缺省页的(可选)
implementation 'com.github.liangjingkanji:BRV:1.3.79'

Contribute

supported by JetBrains

License

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.

net-okhttp3's People

Contributors

liangjingkanji avatar txca avatar tomatowithegg avatar ojzen avatar lukelmouse-github avatar the6nnoo avatar hubrains avatar saltedfish-extreme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.