File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed
src/main/java/org/fossasia/susi/ai Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -181,4 +181,12 @@ dependencies {
181181 // Smart LOck authentication
182182 implementation " com.google.android.gms:play-services-auth:${ rootConfiguration.playServiceAuthVersion} "
183183 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:${ rootConfiguration.kotlinVersion} "
184+
185+ // Stetho
186+ debugImplementation " com.facebook.stetho:stetho:${ rootConfiguration.stethoVersion} "
187+
188+ // Stetho network helper
189+ debugImplementation " com.facebook.stetho:stetho-okhttp3:${ rootConfiguration.stethoVersion} "
190+
191+ releaseImplementation " com.github.iamareebjamal:stetho-noop:1.1"
184192}
Original file line number Diff line number Diff line change 2525 mockitoCoreVersion = ' 1.10.19'
2626 playServiceAuthVersion= ' 16.0.1'
2727 shimmerVersion = " 0.5.0"
28+ stethoVersion = " 1.5.1"
2829}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.annotation.SuppressLint
44import android.app.Application
55import android.support.v7.app.AppCompatDelegate
66import android.util.Log
7+ import com.facebook.stetho.Stetho
78
89import com.squareup.leakcanary.LeakCanary
910
@@ -50,6 +51,8 @@ class MainApplication : Application() {
5051 // Release mode
5152 Timber .plant(ReleaseLogTree ())
5253 }
54+
55+ Stetho .initializeWithDefaults(this )
5356 }
5457
5558 private class ReleaseLogTree : Timber .Tree () {
Original file line number Diff line number Diff line change 11package org.fossasia.susi.ai.rest
22
3+ import com.facebook.stetho.okhttp3.StethoInterceptor
34import okhttp3.OkHttpClient
45import okhttp3.logging.HttpLoggingInterceptor
56import org.fossasia.susi.ai.dataclasses.ReportSkillQuery
@@ -32,7 +33,8 @@ object ClientBuilder {
3233 // Must maintain the order of interceptors here, logging needs to be last.
3334 httpClient.addInterceptor(TokenInterceptor ())
3435 httpClient.addInterceptor(logging)
35-
36+ // Stetho for network monitoring
37+ httpClient.addNetworkInterceptor(StethoInterceptor ())
3638 Retrofit .Builder ()
3739 .baseUrl(PrefManager .susiRunningBaseUrl)
3840 .addConverterFactory(GsonConverterFactory .create())
You can’t perform that action at this time.
0 commit comments