The Network Logging Library is a lightweight Android library for debugging network requests and responses. It provides an easy way to monitor network activity in your Android app, helping you with debugging and performance optimization.
- Log HTTP requests and responses, including headers and bodies.
- Integration with popular HTTP libraries like OkHttp.
- Uses material 3 dynamic color schemes
- Android Studio with a project targeting Android API 28 (Pie) or higher.
To include this library in your project, you can use JitPack.
-
Add the JitPack repository to your project's
build.gradle.ktsfile:allprojects { repositories { // ... maven(url = "https://jitpack.io") } } -
Add the library as a dependency in your app's
build.gradle.kts:dependencies { implementation("com.github.sam829:network_logging:${latestVersion}") }
-
Initialize the library in your application class:
class MyApplication : Application() { override fun onCreate() { super.onCreate() AppTheme { LogSheet(materialTheme = MaterialTheme) } } }
-
Start logging network requests and responses:
val client = OkHttpClient.Builder() .addInterceptor(NetworkLoggingInterceptor(context)) .build() val retrofit = Retrofit.Builder() .baseUrl("baseurl.com") // Set your base url here .client(client) .build()
Contributions are welcome! Feel free to open issues, create pull requests, or provide suggestions and feedback.
This library is licensed under the MIT License - see the LICENSE file for details.