From 0d2ab60f67df6442c613d8055c59f3a60c524022 Mon Sep 17 00:00:00 2001 From: drake Date: Sun, 15 Dec 2024 13:33:43 +0800 Subject: [PATCH] docs: README --- README.md | 7 ++- README_EN.md | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 README_EN.md diff --git a/README.md b/README.md index 88d48c1c..257456cb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +

+ 中文 + | English +

+

基于协程完善的Android网络请求库

@@ -28,8 +33,6 @@ Net是基于[OkHttp](https://github.com/square/okhttp)/协程的非侵入式框
-Welcome to international translation of this project's documents/notes, thank you for your support! - [Net 1.x](https://github.com/liangjingkanji/Net/tree/1.x) 版本使用RxJava实现
[Net 2.x](https://github.com/liangjingkanji/Net/tree/2.x) 版本使用协程实现
[Net-okhttp3](https://github.com/liangjingkanji/Net-okhttp3) Net3.x的Android低版本兼容库
diff --git a/README_EN.md b/README_EN.md new file mode 100644 index 00000000..4074a1e8 --- /dev/null +++ b/README_EN.md @@ -0,0 +1,142 @@ +

+ 中文 + | English +

+ +

+ +

A Comprehensive Android Network Request Library Based on Coroutines

+ +

Documentation + | Access Issues? + | Contribute + | Download Demo +

+ +

+ +

+ + + + + + + +

+ +

+ +
+ +Net is a non-intrusive framework based on [OkHttp](https://github.com/square/okhttp)/Coroutines (compatible with all OkHttp APIs), allowing OkHttp version upgrades to maintain network security. + +
+ +[Net 1.x](https://github.com/liangjingkanji/Net/tree/1.x) version implemented with RxJava
+[Net 2.x](https://github.com/liangjingkanji/Net/tree/2.x) version implemented with Coroutines
+[Net-okhttp3](https://github.com/liangjingkanji/Net-okhttp3) Net3.x compatibility library for lower Android versions
+[Net 3.x](https://github.com/liangjingkanji/Net/) version implemented with Coroutines, customizable OkHttp version + +
+

Contributions and issues are welcome

+ +## Features + +- [x] #1 in Development Efficiency +- [x] Designed Specifically for Android +- [x] OkHttp Best Practices +- [x] High-performance Okio +- [x] Supports All OkHttp APIs +- [x] Upgradable OkHttp Version for Network Security +- [x] Detailed Documentation/Low Learning Curve +- [x] Continuous Community Maintenance + +## Main Functions + +- [x] Coroutine Concurrency (No Coroutine Knowledge Required) +- [x] Concurrent/Serial/Queue/Synchronous Requests +- [x] Quick Thread Switching +- [x] Global Error Handling (Reduced Crash Rate) +- [x] Coroutine Scope with Error and Completion Callbacks +- [x] Converter for Any Data (json/protocol...) +- [x] Generic Type Support for Network Request Returns +- [x] Automatic Pull-to-Refresh and Load-More Handling +- [x] Automatic Pagination Loading +- [x] Automatic Default Page Display +- [x] Automatic Loading Dialog Display +- [x] Automatic Request Cancellation (Lifecycle) +- [x] Automatic Toast Error Messages +- [x] Automatic Exception Catching +- [x] ViewModel Support +- [x] Request Data Carrying (setExtra/tagOf) +- [x] Request ID/Group Support +- [x] Log Output (AndroidStudio Plugin/App Notification) +- [x] Return Fastest Result from Concurrent Requests +- [x] Global Request Cancellation +- [x] Quick HTTPS Configuration +- [x] Cookie Persistence Management +- [x] Timed/Time-Limited Requests +- [x] Force Cache Mode/Custom Cache Key/Cache Validity/LRU Cache Algorithm/Cache Any Data +- [x] Cache-then-Network Request (Preview Mode) +- [x] Built-in Powerful Polling (Timer) +- [x] Monitor Upload/Download Progress (Time Used, Speed per Second, Time Remaining...) + +
+ +## Installation + +Add repository to Project's settings.gradle + +```kotlin +dependencyResolutionManagement { + repositories { + // ... + maven { url 'https://jitpack.io' } + } +} +``` + +Add framework dependency to Module's build.gradle + +```groovy +implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0" // Coroutines (version optional) +implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0' +implementation 'com.squareup.okhttp3:okhttp:4.11.0' // Requires OkHttp4+ +implementation 'com.github.liangjingkanji:Net:3.7.0' +``` +For development on Android 5 (API level 21) and below, please use [Net-okhttp3](https://github.com/liangjingkanji/Net-okhttp3) +
+ +## Contribute + + + +supported by [JetBrains](https://www.jetbrains.com/) + + +## License + +``` +MIT License + +Copyright (c) 2023 劉強東 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` \ No newline at end of file