DEV Community

Cover image for Showify Tv Shows App | Requestly Android Interceptor
MOHIT GUPTA
MOHIT GUPTA

Posted on

Showify Tv Shows App | Requestly Android Interceptor

Hello guys, today I learn Dependency Injection (Dagger-Hilt) for Android with that I build a simple Android app Showify using MVVM Architecture Android.
Showify is simple app which fetch Movies, TV shows details and show them into Recycler View.

Also to debug my API responses I use Requestly debugger which Open Source SDK, with that I can Intercept my API request/response, In-App without dealing with SSL certificate and proxy issues.

Benifits of using Requestly Debugger

  • Open Source
  • Simple 1-time integration (No Proxy or SSL certificate hassles)
  • In-APP and Web Service Interceptor
  • APIs Modifications Possible
  • Also Debug production apps
  • Active support

We can integrate Requestly debugger SDK simply in 2 setps and with 3 lines of code.

Steps to Integrate Requestly

Step 1:- Add the dependency into your build(app) file.

dependencies {
debugImplementation "io.requestly.rqinterceptor:library:1.+"
releaseImplementation "io.requestly.rqinterceptor:library-no-op:1.+"
}

Step 2:- Add these 3 lines code into your Network Module.

val collector = RQCollector(context=appContext, sdkKey="<your-sdk-key>")
val rqInterceptor = RQInterceptor.Builder(appContext)
.collector(collector)
.build()
val client = OkHttpClient.Builder()
.addInterceptor(rqInterceptor)
.build()

If you are using retrofit then simply pass okHttpClient into retrofit client.

Retrofit.Builder()
.baseUrl(APIUtils.API_BASE_URI)
.client(okHttpClient) // okHttpClient with RQInterceptor
.build();

That's all now you can Intercept your the API responses into your app or into requestly web app.

Image description

Thanks for reading this through.
Have a wonderful Day.

Top comments (0)