This library help you check your api history which you use in your app
Download the lastest version via maven and gradle
In your build.gradle app module
def newestVerion = '1.1.15'
dependencies {
implementation "com.kt.api:$newestVerion"
}
Add interceptor to your OkHttpClient
val interceptor = CustomInterceptor()
interceptor.level = CustomInterceptor.Level.BODY
val client = OkHttpClient.Builder()
.addInterceptor(interceptor)
.build()
Retrofit.Builder()
.baseUrl(Constants.DEVICE_BASE_URL[env])
.client(client)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build()
.create(API::class.java)
CustomInterceptor interceptor = new CustomInterceptor();
interceptor.setLevel(CustomInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(interceptor)
.build();
// create retrofit interface
API retrofit = new Retrofit.Builder()
.baseUrl(Constants.DEVICE_BASE_URL[env])
.client(client)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build()
.create(API::class.java);
class WelcomeActivity : BaseActivity() {
...
}
public class WelcomeActivity extends BaseActivity {
...
}