Create java file MyApplication
import android.app.Application; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import com.facebook.stetho.Stetho; public class MyApplication extends Application { public void onCreate() { //Log.i("TAG","MyApplication started"); super.onCreate(); //Stetho.initializeWithDefaults(this); // Create an InitializerBuilder Stetho.InitializerBuilder initializerBuilder = Stetho.newInitializerBuilder(this); // Enable Chrome DevTools initializerBuilder.enableWebKitInspector( Stetho.defaultInspectorModulesProvider(this) ); // Enable command line interface initializerBuilder.enableDumpapp( Stetho.defaultDumperPluginsProvider(this) ); // Use the InitializerBuilder to generate an Initializer Stetho.Initializer initializer = initializerBuilder.build(); // Initialize Stetho with the Initializer Stetho.initialize(initializer); } }
In the androidManifest file add:
<application android:name=".MyApplication">
In the build.gradle(Module.app) add the following to the dependencies:
//Stetho is used to see SQLite database in Chrome. Go to Chrome://inspect // Stetho core compile 'com.facebook.stetho:stetho:1.3.1' //Optional network helper compile 'com.facebook.stetho:stetho-okhttp:1.3.1' compile 'com.facebook.stetho:stetho-js-rhino:1.4.2'