当前位置: 首页>>代码示例>>Java>>正文


Java Stetho类代码示例

本文整理汇总了Java中com.facebook.stetho.Stetho的典型用法代码示例。如果您正苦于以下问题:Java Stetho类的具体用法?Java Stetho怎么用?Java Stetho使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Stetho类属于com.facebook.stetho包,在下文中一共展示了Stetho类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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");
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:WeatherApplication.java

示例2: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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());
    }
}
 
开发者ID:mengdd,项目名称:TodoRealm,代码行数:22,代码来源:TodoApplication.java

示例3: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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);
}
 
开发者ID:Jon6193,项目名称:Android-MVVM,代码行数:24,代码来源:MvvmApplication.java

示例4: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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();
}
 
开发者ID:xizzhu,项目名称:stetho-realm,代码行数:17,代码来源:App.java

示例5: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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);
}
 
开发者ID:beraldofilippo,项目名称:TWStreaming,代码行数:11,代码来源:App.java

示例6: get

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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();
}
 
开发者ID:yshrsmz,项目名称:historian,代码行数:20,代码来源:HistorianInspectorModulesProvider.java

示例7: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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());
}
 
开发者ID:yshrsmz,项目名称:historian,代码行数:19,代码来源:App.java

示例8: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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);
}
 
开发者ID:adithya321,项目名称:Instincts-2k17,代码行数:17,代码来源:InstinctsApplication.java

示例9: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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);
        }
    });
}
 
开发者ID:riteshakya037,项目名称:Android-Scrapper,代码行数:18,代码来源:TallyStackerApplication.java

示例10: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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());
}
 
开发者ID:TryGhost,项目名称:Ghost-Android,代码行数:21,代码来源:DebugSpectreApplication.java

示例11: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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();

}
 
开发者ID:StephanBezoen,项目名称:tumblrlikes,代码行数:19,代码来源:LikesApplication.java

示例12: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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);
}
 
开发者ID:n1rocket,项目名称:eggs-android,代码行数:22,代码来源:MvpApp.java

示例13: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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;
}
 
开发者ID:huangjingqiang,项目名称:SWDemo,代码行数:18,代码来源:AGApplication.java

示例14: onCreate

import com.facebook.stetho.Stetho; //导入依赖的package包/类
@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);
}
 
开发者ID:quangctkm9207,项目名称:mvp-android-arch-component,代码行数:17,代码来源:AndroidApplication.java

示例15: initLibs

import com.facebook.stetho.Stetho; //导入依赖的package包/类
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);
        }
    }
 
开发者ID:beczesz,项目名称:FragmentNavigationPatternDemo,代码行数:20,代码来源:FragmentNavigationDemoApplication.java


注:本文中的com.facebook.stetho.Stetho类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。