Java 类com.facebook.stetho.Stetho 实例源码

项目:GitHub    文件:WeatherApplication.java   
@Override
    public void onCreate() {
        super.onCreate();
        Log.d(TAG, "onCreate start");
        if (BuildConfig.DEBUG) {
            StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
            StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
        }

        applicationComponent = DaggerApplicationComponent.builder()
                .applicationModule(new ApplicationModule(this))
                .build();

//        Fabric.with(this, new Crashlytics());
        Stetho.initializeWithDefaults(this.getApplicationContext());

        weatherApplicationInstance = this;

        //初始化ApiClient
        ApiConfiguration apiConfiguration = ApiConfiguration.builder()
                .dataSourceType(ApiConstants.WEATHER_DATA_SOURCE_TYPE_KNOW)
                .build();
        ApiClient.init(apiConfiguration);
        Log.d(TAG, "onCreate end");
    }
项目:TodoRealm    文件:TodoApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Realm.init(this);

    RealmConfiguration config = new RealmConfiguration.Builder()
            .name("todo.realm")
            .schemaVersion(1)
            .deleteRealmIfMigrationNeeded()
            .build();

    Realm.setDefaultConfiguration(config);

    if (BuildConfig.DEBUG) {
        Stetho.initialize(
                Stetho.newInitializerBuilder(this)
                        .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                        .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
                        .build());
    }
}
项目:Android-MVVM    文件:MvvmApplication.java   
@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;
    }

    LeakCanary.install(this);
    Stetho.initializeWithDefaults(this);

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

    component = DaggerApplicationComponent.builder()
            .applicationModule(new ApplicationModule(this))
            .build();

    component.inject(this);
}
项目:stetho-realm    文件:App.java   
@Override
public void onCreate() {
    super.onCreate();

    Realm.init(this);
    Stetho.initialize(Stetho.newInitializerBuilder(this)
        .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
        .enableWebKitInspector(
            new StethoRealmInspectorModulesProvider.Builder(this).dirs(getFilesDir(),
                new File(getFilesDir(), "custom")).build())
        .build());

    populateRealm();
    populateRealm2();
    populateRealmIgnored();
}
项目:TWStreaming    文件:App.java   
@Override
public void onCreate() {
    super.onCreate();
    singleton = this;

    TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
    Fabric.with(this, new Twitter(authConfig));

    Stetho.initializeWithDefaults(this);
}
项目:historian    文件:HistorianInspectorModulesProvider.java   
@Override
public Iterable<ChromeDevtoolsDomain> get() {
  return new Stetho.DefaultInspectorModulesBuilder(context)
      .provideDatabaseDriver(new SqliteDatabaseDriver(context,
          new DatabaseFilesProvider() {
            @Override
            public List<File> getDatabaseFiles() {
              List<File> list = new ArrayList<>();
              list.add(new File(historian.dbPath()));
              return list;
            }
          }, new DatabaseConnectionProvider() {
        @Override
        public SQLiteDatabase openDatabase(File file) throws SQLiteException {
          return historian.getDatabase();
        }
      }))
      .finish();
}
项目:historian    文件:App.java   
@Override
public void onCreate() {
  super.onCreate();

  historian = Historian.builder(this)
      .build();
  historian.initialize();

  Timber.plant(new Timber.DebugTree());
  Timber.plant(HistorianTree.with(historian));

  Timber.d(historian.dbPath());

  Stetho.initialize(Stetho.newInitializerBuilder(this)
      .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
      .enableWebKitInspector(new HistorianInspectorModulesProvider(this, historian))
      .build());
}
项目:Instincts-2k17    文件:InstinctsApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());

    if (BuildConfig.DEBUG) {
        StrictMode.enableDefaults();

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

    Realm.init(this);
}
项目:Android-Scrapper    文件:TallyStackerApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    TallyStackerApplication.instance = this;
    JodaTimeAndroid.init(this);
    Fabric.with(this, new Crashlytics());
    Fabric.with(this, new Answers());
    Stetho.initializeWithDefaults(this);
    // Setup handler for uncaught exceptions.
    Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread thread, Throwable e) {
            if (!(e instanceof ExpectedElementNotFound))
                handleUncaughtException(e);
        }
    });
}
项目:Ghost-Android    文件:DebugSpectreApplication.java   
@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;
    }

    // DON'T enable leak detection in instrumentation tests
    if (! isRunningEspressoTest()) {
        // auto-detect Activity memory leaks!
        LeakCanary.install(this);
    }

    Stetho.initialize(Stetho.newInitializerBuilder(this)
            .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
            .build());
}
项目:tumblrlikes    文件:LikesApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());

    Prefs.initPrefs(this);

    if (BuildConfig.DEBUG) {
        Stetho.initializeWithDefaults(this);
    }

    FirebaseAnalytics analytics = FirebaseAnalytics.getInstance(this);

    _myComponent = DaggerMyComponent.builder()
            .myModule(new MyModule(this, analytics))
            .build();

}
项目:eggs-android    文件:MvpApp.java   
@Override
public void onCreate() {
    super.onCreate();

    createAppComponent();

    DaggerAndroidInjector.initialize(this);

    AppLogger.init();

    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
        Stetho.initializeWithDefaults(this);
    }

    if (!LeakCanary.isInAnalyzerProcess(this)) {
        LeakCanary.install(this);
    }

    CalligraphyConfig.initDefault(mCalligraphyConfig);
}
项目:SWDemo    文件:AGApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.DEBUG){
        Stetho.initializeWithDefaults(this);
    }
    ApiRESTful apiRESTful = ApiRESTful.getApiRESTful(this, false);
    apiRESTful.setModelUrl(AppConfig.HOST);
    apiRESTful.setPushWs("");
    apiRESTful.setAutoToWs(false);
    apiRESTful.setCardId("04df-ee031b69-0000-4e02-8a56-41736fc1226a-e0000000");
    apiRESTful.setHeadersPrefix("x-hz-");
    OkHttpClient.Builder builder = new OkHttpClient.Builder();
    builder.addNetworkInterceptor(new StethoInterceptor());
    //apiRESTful.setOKHttpClientBuider(builder);
    ALog.debug = true;
}
项目:mvp-android-arch-component    文件:AndroidApplication.java   
@Override
public void onCreate() {
  super.onCreate();

  initializeDependencies();

  if (BuildConfig.DEBUG) {
    Timber.plant(new Timber.DebugTree());
    Stetho.initializeWithDefaults(this);
  }

  if (LeakCanary.isInAnalyzerProcess(this)) {
    return;
  }
  LeakCanary.install(this);
}
项目:FragmentNavigationPatternDemo    文件:FragmentNavigationDemoApplication.java   
private void initLibs() {

        // Initialize dagger
        DaggerManager.getInstance().buildComponentAndInject(this);

        //@formatter:off
        // Initialize typeface helper
        TypefaceCollection typeface = new TypefaceCollection.Builder()
                .set(Typeface.NORMAL, Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf"))
                .set(Typeface.BOLD, Typeface.createFromAsset(getAssets(), "fonts/Roboto-Medium.ttf"))
                .create();
        TypefaceHelper.init(typeface);
        //@formatter:on

        if (BuildConfig.DEBUG) {
            // Facebook Stetho
            Stetho.initializeWithDefaults(this);
        }
    }
项目:Project-Chao    文件:Chao.java   
@Override public void onCreate() {
  super.onCreate();
  sInstance = this;

  RealmConfiguration configuration =
      new RealmConfiguration.Builder(this).deleteRealmIfMigrationNeeded()
          .migration(new RealmMigration() {
            @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
            }
          })
          .name("chao.realm")
          .build();

  Realm.setDefaultConfiguration(configuration);

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

  FacebookSdk.sdkInitialize(getApplicationContext());
  AppEventsLogger.activateApp(this);
}
项目:erlymon-monitor-android    文件:MainApp.java   
@Override
public void onCreate() {
    super.onCreate();

    Stetho.initializeWithDefaults(this);

    CrashlyticsCore core = new CrashlyticsCore.Builder()
            .disabled(BuildConfig.DEBUG)
            .build();
    Fabric.with(this, new Crashlytics.Builder().core(core).build(), new Crashlytics());

    // ...

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

    MainApp.init(getBaseContext());
}
项目:StethoRealm    文件:RealmInspectorModulesProvider.java   
public RealmInspectorModulesProvider build() {
    final InspectorModulesProvider baseProvider =
            (this.baseProvider != null)
                    ? this.baseProvider
                    : Stetho.defaultInspectorModulesProvider(applicationContext);

    //noinspection deprecation
    return new RealmInspectorModulesProvider(
            applicationContext.getPackageName(),
            baseProvider,
            folder,
            withMetaTables,
            databaseNamePattern,
            limit,
            ascendingOrder,
            defaultEncryptionKey,
            encryptionKeys);
}
项目:ibeacon-scanner-android    文件:AppApplication.java   
@Override
public void onCreate()
{
    super.onCreate();

    // initialize LeakCanary
    if (LeakCanary.isInAnalyzerProcess(this))
    {
        return;
    }
    LeakCanary.install(this);

    // initialize Facebook Stetho
    Stetho.initializeWithDefaults(this);

    // initialize In The Pockets iBeaconScanner
    IBeaconScanner.initialize(IBeaconScanner.newInitializer(this).build());
}
项目:Udacity-Capstone-Project    文件:App.java   
@Override
public void onCreate() {
    super.onCreate();
    Realm.init(this);
    globalContext = this.getApplicationContext();
    TwitterAuthConfig authConfig = new TwitterAuthConfig(getString(R.string.twitter_key),getString(R.string.twitter_secret));
    Fabric.with(this, new Twitter(authConfig));
    facebookInit();
    FirebaseDatabase.getInstance().setPersistenceEnabled(true);
    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                    .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
                    .build());
    Dexter.initialize(this);
}
项目:glide-support    文件:GlideModule.java   
@Override public void registerComponents(Context context, Glide glide) {
        Stetho.initializeWithDefaults(context);
        final Cache cache = new Cache(new File(context.getCacheDir(), "okhttp"), IMAGE_CACHE_SIZE);

        HttpLoggingInterceptor logger = new HttpLoggingInterceptor();
//      logger.setLevel(Level.BASIC);

        OkHttpClient client = new OkHttpClient()
                .newBuilder()
                .cache(cache)
                .addNetworkInterceptor(new StethoInterceptor())
                .addInterceptor(logger)
                .build();

        glide.register(CachedGlideUrl.class, InputStream.class,
                superFactory(new OkHttpUrlLoader.Factory(client), CachedGlideUrl.class));
        glide.register(ForceLoadGlideUrl.class, InputStream.class,
                superFactory(new OkHttpUrlLoader.Factory(client), ForceLoadGlideUrl.class));
    }
项目:reductor    文件:ReductorApp.java   
@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());

}
项目:Stetho-Couchbase    文件:MainApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
        Stetho.initialize(
                Stetho.newInitializerBuilder(this)
                        .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                        .enableWebKitInspector(new CouchbaseInspectorModulesProvider.Builder(this)
                                .showMetadata(true) // Default: true
                                .build())
                        .build());
    }
    initializeCouchbase(this);
}
项目:wakatime-android-client    文件:WakatimeApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    LeakCanary.install(this);
    AndroidThreeTen.init(this);
    Stetho.initializeWithDefaults(this);
    installTimber();
    this.registerApplicationComponent();
    this.registerApiKeyComponent();
    this.registerNetworkComponent();
    this.registerDashboardComponent();
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
            .setDefaultFontPath("fonts/Lato-Regular.ttf")
            .setFontAttrId(R.attr.fontPath)
            .build()
    );
}
项目:Sunshine_WeatherApp    文件:MyApplication.java   
@Override
    public void onCreate() {
        super.onCreate();
        // 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);
    }
项目:tasktrckr    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Stetho.initializeWithDefaults(this);

    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(MainActivity.this, InsertTaskActivity.class));
        }
    });
}
项目:Anago    文件:AnagoApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    if (!isUnitTest()) {
        if (LeakCanary.isInAnalyzerProcess(this)) {
            return;
        }
        LeakCanary.install(this);

        Stetho.initializeWithDefaults(this);

        Timber.plant(new Timber.DebugTree());
    }

    injector = buildAppComponent();
}
项目:nono-android    文件:MyApp.java   
@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());
}
}
项目:HeroVideo-master    文件:HeroVideoApp.java   
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());
}
项目:GitHub    文件:ComparisonApp.java   
@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());
}
项目:android-ponewheel    文件:App.java   
@Override
public void onCreate() {
    super.onCreate();
    if (BuildConfig.DEBUG) {
        Stetho.initializeWithDefaults(this);
        Timber.plant(new Timber.DebugTree());
    }
    initWakeLock();
    initDatabase();
}
项目:redux-observable    文件:App.java   
@Override
public void onCreate() {
    super.onCreate();
    initTimber();
    SoLoader.init(this, false);
    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                    .enableWebKitInspector(new LithoWebKitInspector(this))
                    .build());
    Fresco.initialize(this);

    appComponent = makeAppComponent();
}
项目:GSB-2017-Android    文件:GSBApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    instance = this;
    Stetho.initializeWithDefaults(this);
    new OkHttpClient.Builder()
            .addNetworkInterceptor(new StethoInterceptor())
            .build();
    //setDummyData();
    clearDummyData();
    ServiceGenerator.setup();
    Log.i("Setup" , "Complete");
}
项目:YandexTranslator    文件:App.java   
@Override
public void onCreate() {
    super.onCreate();
    DI.getDI().init(this);

    if (BuildConfig.DEBUG) {
        Stetho.initializeWithDefaults(this);
    }
}
项目:MovieApp    文件:MovieApp.java   
@Override
public void onCreate() {
    super.onCreate();

    Realm.init(this);
    RealmConfiguration config = new RealmConfiguration.Builder().deleteRealmIfMigrationNeeded().build();
    Realm.setDefaultConfiguration(config);

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

    LeakCanary.install(this);
    app  = this;
    if(BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
        Stetho.initialize(
                Stetho.newInitializerBuilder(this)
                        .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                        .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
                        .build());
    }

    Timber.i("Creating Application");
}
项目:stetho-realm    文件:StethoRealmInspectorModulesProvider.java   
public StethoRealmInspectorModulesProvider build() {
    if (baseProvider == null) {
        baseProvider = Stetho.defaultInspectorModulesProvider(applicationContext);
    }
    if (dirs == null || dirs.length == 0) {
        dirs = new File[] { applicationContext.getFilesDir() };
    }
    final Pattern namePattern = Pattern.compile(
        TextUtils.isEmpty(this.namePattern) ? ".+\\.realm" : this.namePattern);
    return new StethoRealmInspectorModulesProvider(applicationContext, baseProvider, dirs,
        namePattern, encryptionKeys);
}
项目:Android-NoSql    文件:MainApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Stetho.initializeWithDefaults(this);

    AndroidNoSql.initWith(
            new PaperDataSaver(this),
            //new SharedPreferencesDataSaver(getSharedPreferences("test", Context.MODE_PRIVATE)),
            new LogDataSaver("LogDataSaver")
    );
}
项目:BilibiliClient    文件:BilibiliApp.java   
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());
}
项目:BilibiliClient    文件:BilibiliApp.java   
private void init() {
    ThemeUtils.setSwitchColor(this); // 初始化主题切换
    LeakCanary.install(this);
    Stetho.initialize(Stetho.newInitializerBuilder(this)
                    .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                    .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
                    .build());
}
项目:Quran    文件:DebugApplication.java   
@Override
public void onCreate() {
  super.onCreate();

  if (!LeakCanary.isInAnalyzerProcess(this)) {
    Timber.plant(new Timber.DebugTree());
    Stetho.initializeWithDefaults(this);
    LeakCanary.install(this);
  }
}