explaingit

jeasonlzy/okhttp-okgo

10,579JavaAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

An Android networking library that simplifies HTTP requests by wrapping OkHttp, adding built-in response caching, RxJava support, and a companion module for batch file downloads and uploads.

Mindmap

mindmap
  root((OkGo))
    What it does
      HTTP networking
      Wraps OkHttp
      Android library
    Features
      Response caching
      Batch downloads
      Batch uploads
    Integrations
      RxJava support
      OkServer module
    Tech stack
      Java
      Android
      OkHttp
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add reliable HTTP networking to an Android app with minimal boilerplate by dropping in OkGo as a single Gradle dependency.

USE CASE 2

Implement a download manager in an Android app that queues multiple files and tracks progress on each one using the OkServer module.

USE CASE 3

Cache server responses locally in an Android app to reduce repeated network calls and support offline use.

USE CASE 4

Integrate RxJava streams into Android networking code using OkGo's dedicated RxJava2 companion module.

Tech stack

JavaAndroidOkHttpRxJava

Getting it running

Difficulty · easy Time to first run · 30min

Add a single line to build.gradle to include OkGo, optional RxJava and OkServer modules are separate dependencies you add only if needed.

Use freely for any purpose, including commercial use, as long as you include the Apache 2.0 license notice in your project.

In plain English

OkGo is a networking library for Android apps, written in Java. Its job is to make it easier for Android developers to send HTTP requests, which are the calls an app makes to a server when it needs to load data, submit a form, upload a photo, or download a file. The library wraps a lower-level tool called OkHttp, removing a lot of the repetitive setup code that OkHttp normally requires. The library supports two popular approaches for handling asynchronous work in Android called RxJava and RxJava2. It also includes a customizable caching system, so apps can store server responses locally and avoid repeating identical network calls. Beyond basic requests, OkGo includes a companion module called OkServer that adds batch download management and batch upload management, letting apps queue multiple files and track progress on all of them at once. To add OkGo to a project, a developer adds one dependency line to their build file. Optional companion modules for RxJava support or the download/upload manager can be added separately depending on what the app needs. The README is written primarily in Chinese and includes animated demo screenshots showing features like file downloading and uploading in action. The project follows the Apache 2.0 license. Documentation is maintained as a GitHub Wiki that stays in sync with the latest release. The author notes that the older 2.x version of the library is no longer maintained, and all bug fixes go into the current 3.x line. Support is available through a QQ group forum where users can ask questions. OkGo targets Android API level 14 and higher, which covers nearly all Android devices still in active use. The project has been archived and is no longer under active development, but the code remains available and the existing feature set is stable.

Copy-paste prompts

Prompt 1
Using OkGo for Android, write a Java method that uploads a photo file with a progress listener and handles network errors with a retry on failure.
Prompt 2
I am using OkGo's OkServer module. Write code to queue three file downloads and display a combined progress bar in an Android activity.
Prompt 3
Set up OkGo in an Android project with a global response cache of 30 minutes and a custom callback that parses the JSON body into a POJO automatically.
Prompt 4
Convert an OkGo async GET request that returns a JSON list to use RxJava2 Observables instead of the default callback interface.
Open on GitHub → Explain another repo

← jeasonlzy on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.