It took three years to open source for the rise of the country! Full open source is not profitable! I hope people with lofty ideals join me!

  1. This is our new self-developed network framework
  2. Of course I’m not Retrofit
  3. Retrofit is not the same as OkHttp. Can OkHttp be Retrofit?
  4. I am an OkHttp shell if you must, but I will delete the OkHttp code in the future
  5. It’s natural to borrow from existing open source projects, and you may have misconceptions about open source
  6. Net uses hot plug, formal validation and is 6000% faster than Retrofit development
  7. But point 6 is not about this version, it’s about Net2.x
  8. In the future we plan to eliminate JDK/Java/Kotlin/C/ even UTF-8

The air Force is currently recruiting heavily

Not just an asynchronous task library for network requests

Making | | backup access using document


Not the strongest network task library on Android, based on OkHttp and perfectly supports all its function components, supports high concurrency coroutine network requests


Net 1.x version is implemented by RxJava. Net 2.x version is implemented by coroutine (developers can use it without having to master coroutine). Net 3.x version is implemented by OkHttp, and OkHttp version is not limited


Welcome to contribute code/questions


The main function

  • Kotlin
  • Coroutines (even if you don’t know coroutines)
  • Concurrent/serial requests
  • Queue/synchronous requests
  • Fast thread switching
  • DSL scoped programming
  • Cooperate with the ViewModel
  • Data converter
  • The queue/synchronization request returns Result
  • Automatic JSON parsing
  • Automatically handles pull-down refresh and pull-up load
  • Handles paging loads automatically
  • Automatic default page
  • Automatically process the life cycle
  • Automatically handles the load dialog box
  • Automatic error message toast
  • Automatic exception catching (locating the request)
  • Use any generic (String/Response/File/List/Map/Pair…). Analytical data
  • Request stores key-value pairs of tags
  • Request Supports Id/Group
  • Log logger (solve log too long display is not clear data encryption and other problems, more powerful than packet capture)
  • The result of the fastest concurrent request is returned
  • Global cancel request/automatic cancel request
  • Coroutine scope supports error and end callbacks
  • You can read the cache forcibly and then refresh the network request
  • Built in super round robin (countdown)
  • Listen for upload/download progress information (usage time, speed per second, remaining time…)


The installation

Add the repository to build. Gradle in the project root directory

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

Add dependencies to build.gradle in module

// Coroutine library (version can be customized)
implementation 'org. Jetbrains. Kotlinx: kotlinx coroutines -- core: 1.3.9'
implementation 'org. Jetbrains. Kotlinx: kotlinx coroutines - android: 1.3.9'

// OkHttp(version can be customized, requiring OkHttp4 or later)
implementation "Com. Squareup. Okhttp3: okhttp: 4.9.1." "
// Net
implementation 'com. Making. Liangjingkanji: Net: 3.0.10'

// Support automatic pull-down refresh and default page (optional)
implementation 'com. Making. Liangjingkanji: BRV: 1.3.22'
Copy the code

If you are developing on Android 4.4 (API Level 19) and require okHttp3. x please use: net-okHttp3

Contribute

Debug huawei phones purchased at official flagship stores

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.
Copy the code