當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。