@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"); }
@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()); } }
@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); }
@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(); }
@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); }
@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(); }
@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()); }
@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); }
@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); } }); }
@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()); }
@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(); }
@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); }
@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; }
@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); }
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); } }
@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); }
@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()); }
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); }
@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()); }
@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); }
@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)); }
@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()); }
@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); }
@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() ); }
@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); }
@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)); } }); }
@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(); }
@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()); } }
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()); }
@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()); }
@Override public void onCreate() { super.onCreate(); if (BuildConfig.DEBUG) { Stetho.initializeWithDefaults(this); Timber.plant(new Timber.DebugTree()); } initWakeLock(); initDatabase(); }
@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(); }
@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"); }
@Override public void onCreate() { super.onCreate(); DI.getDI().init(this); if (BuildConfig.DEBUG) { Stetho.initializeWithDefaults(this); } }
@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"); }
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); }
@Override public void onCreate() { super.onCreate(); Stetho.initializeWithDefaults(this); AndroidNoSql.initWith( new PaperDataSaver(this), //new SharedPreferencesDataSaver(getSharedPreferences("test", Context.MODE_PRIVATE)), new LogDataSaver("LogDataSaver") ); }
private void init() { ThemeUtils.setSwitchColor(this); // 初始化主题切换 LeakCanary.install(this); Stetho.initialize(Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this)) .build()); }
@Override public void onCreate() { super.onCreate(); if (!LeakCanary.isInAnalyzerProcess(this)) { Timber.plant(new Timber.DebugTree()); Stetho.initializeWithDefaults(this); LeakCanary.install(this); } }