Java Code Examples for com.facebook.stetho.Stetho#initialize()

The following examples show how to use com.facebook.stetho.Stetho#initialize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShillelaghApp.java    From shillelagh with Apache License 2.0 6 votes vote down vote up
@Override public void onCreate() {
  super.onCreate();

  // stetho for debugging databases
  Stetho.initialize(Stetho.newInitializerBuilder(this)
          .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
          .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
          .build());

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
        .detectAll()
        .penaltyDeath()
        .build());
    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
        .detectAll()
        .penaltyDeath()
        .build());
  }

  SQLiteOpenHelper sqliteOpenHelper = new ExampleSqliteHelper(this);
  shillelagh = new Shillelagh(sqliteOpenHelper);
}
 
Example 2
Source File: ChatApp.java    From BLEMeshChat with Mozilla Public License 2.0 6 votes vote down vote up
@Override public void onCreate() {
    super.onCreate();

    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());

        Stetho.initialize(
                Stetho.newInitializerBuilder(this)
                        .enableDumpapp(
                                Stetho.defaultDumperPluginsProvider(this))
                        .enableWebKitInspector(
                                Stetho.defaultInspectorModulesProvider(this))
                        .build());
    }

    // If we abandon Timber logging in this app, enable below line
    // to enable Timber logging in sdk
    //Logging.forceLogging();
}
 
Example 3
Source File: MyApp.java    From nono-android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onCreate() {
	super.onCreate();
	singleInstance = this;
	iniIM();
	new Thread(new Runnable() {
		@Override
		public void run() {
			NotificationDataModel.applicationContextRef = new WeakReference<Context>(getApplicationContext());
			volleyRequestQueue = Volley.newRequestQueue(getApplicationContext());
			applicationContext = getApplicationContext();
			Fresco.initialize(singleInstance);
			MobclickAgent.openActivityDurationTrack(false);
		}
	}).start();
       iniMonitor();
       iniShareSDK();
	if(BuildConfig.DEBUG == true){
	Stetho.initialize(
			Stetho.newInitializerBuilder(this)
					.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
					.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
					.build());
}
}
 
Example 4
Source File: ReductorApp.java    From reductor with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    final AppStateReducer vanillaReducer = AppStateReducer.builder()
            .notesReducer(NotesListReducer.create())
            .filterReducer(NotesFilterReducer.create())
            .build();
    store = Store.create(
            new SetStateReducer<>(
                    new UndoableReducer<>(vanillaReducer)));

    Stetho.initialize(Stetho.newInitializerBuilder(this)
            .enableWebKitInspector(() -> new Stetho.DefaultInspectorModulesBuilder(ReductorApp.this)
                    .runtimeRepl(createRuntimeRepl())
                    .finish())
            .build());

}
 
Example 5
Source File: ComparisonApp.java    From fresco with MIT License 6 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  final Context context = this;
  Stetho.initialize(
      Stetho.newInitializerBuilder(context)
          .enableDumpapp(
              new DumperPluginsProvider() {
                @Override
                public Iterable<DumperPlugin> get() {
                  return new Stetho.DefaultDumperPluginsBuilder(context)
                      .provide(new FrescoStethoPlugin())
                      .finish();
                }
              })
          .build());
}
 
Example 6
Source File: JDApplication.java    From JianDan with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate() {
    StrictModeUtil.init();
    super.onCreate();
    refWatcher = LeakCanary.install(this);
    mContext = this;
    ImageLoadProxy.initImageLoader(this);

    if (BuildConfig.DEBUG) {
        Logger.init().hideThreadInfo().setMethodCount(1).setLogLevel(LogLevel.FULL);
    }

    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
                    .build());

}
 
Example 7
Source File: DebugSpectreApplication.java    From quill with MIT License 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    if (LeakCanary.isInAnalyzerProcess(this)) {
        // This process is dedicated to LeakCanary for heap analysis.
        // You should not init your app in this process.
        return;
    }

    // auto-detect Activity memory leaks!
    LeakCanary.install(this);

    Stetho.initialize(Stetho.newInitializerBuilder(this)
            .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
            .build());
}
 
Example 8
Source File: ClientApplication.java    From githot with Apache License 2.0 5 votes vote down vote up
private void initStetho() {
    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
                    .build());
}
 
Example 9
Source File: DebugUtils.java    From COCOFramework with Apache License 2.0 5 votes vote down vote up
public static void setupStetho(Context context) {
    Stetho.initialize(
            Stetho.newInitializerBuilder(context)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(context))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(context))
                    .build());
}
 
Example 10
Source File: DebugAppLifecycleCallbacks.java    From Qiitanium with MIT License 5 votes vote down vote up
protected void setupStetho() {
  Stetho.initialize(
      Stetho.newInitializerBuilder(app)
          .enableDumpapp(Stetho.defaultDumperPluginsProvider(app))
          .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(app))
          .build());
}
 
Example 11
Source File: HackerNewsApplication.java    From hacker-news-android with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    if (sInstance == null) {
        sInstance = this;
    }

    if("release".equals(BuildConfig.BUILD_TYPE)){
        Bugsnag.init(this);
    }

    mContext = getApplicationContext();
    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                  .enableDumpapp(
                          Stetho.defaultDumperPluginsProvider(this))
                  .enableWebKitInspector(
                          Stetho.defaultInspectorModulesProvider(this))
                  .build());

    sAppModule = new AppModule(this);
    sAppComponent = DaggerAppComponent.builder()
                                      .appModule(sAppModule)
                                      .build();
    sAppComponent.inject(this);

    LocalDataManager.initialize(mContext);
}
 
Example 12
Source File: HeroVideoApp.java    From HeroVideo-master with Apache License 2.0 5 votes vote down vote up
private void init() {
    // 初始化主题切换
    ThemeUtils.setSwitchColor(this);
    //初始化Leak内存泄露检测工具
    LeakCanary.install(this);
    //初始化Stetho调试工具
    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
                    .build());
}
 
Example 13
Source File: SampleDebugApplication.java    From stetho with MIT License 5 votes vote down vote up
private void initializeStetho(final Context context) {
  // See also: Stetho.initializeWithDefaults(Context)
  Stetho.initialize(Stetho.newInitializerBuilder(context)
      .enableDumpapp(new DumperPluginsProvider() {
        @Override
        public Iterable<DumperPlugin> get() {
          return new Stetho.DefaultDumperPluginsBuilder(context)
              .provide(new HelloWorldDumperPlugin())
              .provide(new APODDumperPlugin(context.getContentResolver()))
              .finish();
        }
      })
      .enableWebKitInspector(new ExtInspectorModulesProvider(context))
      .build());
}
 
Example 14
Source File: DebugAppLifecycleCallbacks.java    From photosearcher with Apache License 2.0 5 votes vote down vote up
protected void setupStetho() {
    Stetho.initialize(
            Stetho.newInitializerBuilder(mApp)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(mApp))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(mApp))
                    .build());
}
 
Example 15
Source File: ZhihuApplication.java    From RxZhihuPager with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    Logger.init(TAG);
    Stetho.initialize(Stetho.newInitializerBuilder(this)
            .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
            .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
            .build());
    LeakCanary.install(this);
    Fresco.initialize(this);
}
 
Example 16
Source File: StethoInitializer.java    From droidconat-2016 with Apache License 2.0 5 votes vote down vote up
public void init() {
    Timber.plant(new StethoTree());
    Stetho.initialize(
            Stetho.newInitializerBuilder(context)
                    .enableDumpapp(this)
                    .enableWebKitInspector(createWebkitModulesProvider())
                    .build());
}
 
Example 17
Source File: DebugApp.java    From talk-android with MIT License 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    Stetho.initialize(Stetho.newInitializerBuilder(this)
            .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
            .build());
}
 
Example 18
Source File: HeroVideoApp.java    From HeroVideo-master with Apache License 2.0 5 votes vote down vote up
private void init() {
    // 初始化主题切换
    ThemeUtils.setSwitchColor(this);
    //初始化Leak内存泄露检测工具
    LeakCanary.install(this);
    //初始化Stetho调试工具
    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
                    .build());
}
 
Example 19
Source File: StethoUtils.java    From OpenLibre with GNU General Public License v3.0 5 votes vote down vote up
static void install(Application application, File dataPath){
     // debugging tool
     Stetho.initialize(
             Stetho.newInitializerBuilder(application)
                     .enableDumpapp(Stetho.defaultDumperPluginsProvider(application))
                     .enableWebKitInspector(RealmInspectorModulesProvider
                             .builder(application)
                             .withFolder(dataPath)
                             .withMetaTables()
                             .withLimit(1000000)
                             .databaseNamePattern(Pattern.compile(".+\\.realm"))
                             .build())
                     .build());
}
 
Example 20
Source File: ZhuanlanApplication.java    From ZhuanLan with Apache License 2.0 4 votes vote down vote up
private void initStetho() {
    Stetho.initialize(Stetho.newInitializerBuilder(this)
            .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
            .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
            .build());
}