Search in sources :

Example 1 with Fabric

use of io.fabric.sdk.android.Fabric in project zype-android by zype.

the class ZypeApp method initFabric.

private void initFabric() {
    if (!BuildConfig.DEBUG) {
        Fabric.with(this, new Crashlytics());
    } else {
        final Fabric fabric = new Fabric.Builder(this).kits(new Crashlytics()).debuggable(true).build();
        Fabric.with(fabric);
    }
}
Also used : Fabric(io.fabric.sdk.android.Fabric) Crashlytics(com.crashlytics.android.Crashlytics)

Example 2 with Fabric

use of io.fabric.sdk.android.Fabric in project Just-Another-Android-App by athkalia.

the class App method initFabric.

/**
 * Setup Fabric. We also set the build time and sha key so that we can easily reproduce bug reports.
 *
 * Note 1: To send an exception to crashlytics use {@link Crashlytics#logException(Throwable)}. It will send a non-fatal exception.
 * This is reported separately in the crashlytics dashboard. See
 * https://docs.fabric.io/android/crashlytics/caught-exceptions.html?caught%20exceptions#caught-exceptions for more details.
 *
 * Note 2: To log a statement in Crashlytics use {@link Crashlytics#log(String)}. This log statement will appear when clicking on a
 * specific crash report. For example if you have a crash that occurred 10 times, one would need to click through all 10 instances of
 * that crash to see the individual log statements for every instance of this crash.
 * See https://docs.fabric.io/android/crashlytics/enhanced-reports.html for more info.
 *
 * Note 3: To log a key-value pair in Crashlytics use {@link Crashlytics#setString(String, String)}. Same concept as logging a
 * statement described in Note 2.
 */
private void initFabric() {
    CrashlyticsCore crashlyticsCore = new CrashlyticsCore.Builder().disabled(// 'debug' builds not using fabric, 'qa' and 'release' do.
    "debug".equals(BuildConfig.BUILD_TYPE)).build();
    Crashlytics crashlytics = new Crashlytics.Builder().core(crashlyticsCore).build();
    Answers answers = new Answers();
    final Fabric fabric = new Fabric.Builder(getApplicationContext()).kits(crashlytics, answers).debuggable(// 'debug' and 'qa' build types have extra log statements, 'release' build type doesn't.
    BuildConfig.DEBUG).build();
    Fabric.with(fabric);
    Crashlytics.setString("GIT_SHA_KEY", BuildConfig.GIT_SHA);
    Crashlytics.setString("BUILD_TIME", BuildConfig.BUILD_TIME);
}
Also used : CrashlyticsCore(com.crashlytics.android.core.CrashlyticsCore) Answers(com.crashlytics.android.answers.Answers) Fabric(io.fabric.sdk.android.Fabric) Crashlytics(com.crashlytics.android.Crashlytics)

Example 3 with Fabric

use of io.fabric.sdk.android.Fabric in project jianshi by wingjay.

the class JianShiApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    appComponent = DaggerAppComponent.builder().appModule(new AppModule(JianShiApplication.this)).build();
    final Fabric fabric = new Fabric.Builder(this).kits(new Crashlytics()).debuggable(true).build();
    Fabric.with(fabric);
    Stetho.initializeWithDefaults(this);
    instance = this;
    FlowManager.init(new FlowConfig.Builder(this).openDatabasesOnInit(true).build());
    initLog();
    CalligraphyConfig.initDefault(new CalligraphyConfig.Builder().setDefaultFontPath("fonts/jianshi_default.otf").setFontAttrId(R.attr.fontPath).build());
}
Also used : FlowConfig(com.raizlabs.android.dbflow.config.FlowConfig) AppModule(com.wingjay.jianshi.di.AppModule) Fabric(io.fabric.sdk.android.Fabric) Crashlytics(com.crashlytics.android.Crashlytics)

Aggregations

Crashlytics (com.crashlytics.android.Crashlytics)3 Fabric (io.fabric.sdk.android.Fabric)3 Answers (com.crashlytics.android.answers.Answers)1 CrashlyticsCore (com.crashlytics.android.core.CrashlyticsCore)1 FlowConfig (com.raizlabs.android.dbflow.config.FlowConfig)1 AppModule (com.wingjay.jianshi.di.AppModule)1