An intellij platform plugin. To analyze details of requests and responses from OkHttp.
- Kotlin - Kotlin on Android is a “first-class” language and it has a lot of benefits.
- MVVM & MVI Architecture - Modern, maintainable, and Google suggested app architecture.
- Coroutine + Flow = MVI
- Retrofit - Type-safe HTTP client for Android and Java.
- OkHttp - Meticulous HTTP client for the JVM, Android, and GraalVM.
- Moshi - Modern JSON library for Android, Java and Kotlin. It makes it easy to parse JSON into Java and Kotlin classes.
- Jetpack Components - Compose, ViewModel and more.
- add maven url in your root
build.gradle
:
repositories {
maven { url('https://repo1.maven.org/maven2/') }
...
}
- add dependency in your module
build.gradle
dependencies {
implementation "androidx.compose.ui:ui:$compose_version"
// implementation project(':interceptors')
implementation('io.github.bytebeats:okhttp-analyzer-interceptor:$LATEST_VERSION')//-n means okhttp major version. like 4 means 4.9.3, 3 means 3.14.9
}
Note: LATEST_VERSION
: 0.1.3-4
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
builder.addInterceptor(new OkHttpAnalyzerInterceptor());
}
OkHttpClient client = builder.build();
val builder = OkHttpClient.Builder()
if (BuildConfig.DEBUG) {
builder.addInterceptor(OkHttpAnalyzerInterceptor() )
}
val client = builder.build()
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
builder.addInterceptor(new OkHttpAnalyzerInterceptor());
}
OkHttpClient client = builder.build();
Retrofit retrofit = new Retrofit.Builder()
......
.client(client)
.build();
val builder = OkHttpClient.Builder()
if (BuildConfig.DEBUG) {
builder.addInterceptor( OkHttpAnalyzerInterceptor() )
}
val client = builder.build()
val retrofit = Retrofit.Builder()
......
.client(client)
.build()
Copyright (c) 2021 Chen Pan
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.