|
3 rokov pred | |
---|---|---|
.github | 4 rokov pred | |
docs | 3 rokov pred | |
gradle | 3 rokov pred | |
net | 3 rokov pred | |
sample | 3 rokov pred | |
.gitignore | 5 rokov pred | |
LICENSE | 3 rokov pred | |
README.md | 3 rokov pred | |
build.gradle | 3 rokov pred | |
gradle.properties | 3 rokov pred | |
gradlew | 5 rokov pred | |
gradlew.bat | 5 rokov pred | |
mkdocs.yml | 3 rokov pred | |
settings.gradle | 3 rokov pred | |
signed | 3 rokov pred |
不仅仅是网络请求的异步任务库
Android上不是最强网络任务库, 基于OkHttp/协程的非侵入式框架. 完美支持其原有函数和组件, 兼具Kotlin的优雅函数设计
Net 1.x 版本使用RxJava实现
Net 2.x 版本使用协程实现
Net 3.x 版本使用OkHttp+协程实现, 可指定其OkHttp版本
欢迎贡献代码/问题
主要功能
添加远程仓库根据创建项目的 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-android:1.5.1'
// OkHttp(版本可自定, 要求OkHttp4以上版本)
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
// Net
implementation 'com.github.liangjingkanji:Net:3.1.1'
// 支持自动下拉刷新和缺省页的(可选)
implementation 'com.github.liangjingkanji:BRV:1.3.51'
如果你是在 Android 5 (API level 21)以下开发, 要求使用OkHttp3.x请使用: Net-okhttp3
supported by JetBrains
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.