Search in sources :

Example 6 with Crashlytics

use of com.crashlytics.android.Crashlytics 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 7 with Crashlytics

use of com.crashlytics.android.Crashlytics in project MusicDNA by harjot-oberai.

the class MusicDNAApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    refWatcher = LeakCanary.install(this);
}
Also used : Crashlytics(com.crashlytics.android.Crashlytics)

Example 8 with Crashlytics

use of com.crashlytics.android.Crashlytics in project android-bootstrap by AndroidBootstrap.

the class BootstrapApplicationImpl method init.

@Override
protected void init() {
    // Start Crashlytics.
    Fabric.with(this, new Crashlytics());
    // Set the type of logger, crashlytics in release mode
    Timber.plant(new CrashlyticsTree());
}
Also used : CrashlyticsTree(com.donnfelker.android.bootstrap.logging.CrashlyticsTree) Crashlytics(com.crashlytics.android.Crashlytics)

Example 9 with Crashlytics

use of com.crashlytics.android.Crashlytics 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)

Example 10 with Crashlytics

use of com.crashlytics.android.Crashlytics in project ChatExchange by HueToYou.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fabric.with(this, new Crashlytics());
    setContentView(R.layout.activity_main);
    hueUtils = new HueUtils();
    mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
    mEditor = mSharedPrefs.edit();
    mEditor.apply();
    mHandler = new Handler();
    //        mEditor.putInt("tabIndex", 0).apply();
    mUseDark = mSharedPrefs.getBoolean("isDarkMode", false);
    mFragmentManager = getSupportFragmentManager();
    mIntent = getIntent();
    setup();
    hueUtils.setActionBarColorDefault(this);
    hueUtils.setAddChatFabColorDefault(this);
//ColorPickerDialog.newBuilder().setColor(color).show(activity);
}
Also used : HueUtils(com.huetoyou.chatexchange.ui.misc.HueUtils) Handler(android.os.Handler) Crashlytics(com.crashlytics.android.Crashlytics)

Aggregations

Crashlytics (com.crashlytics.android.Crashlytics)19 Intent (android.content.Intent)3 Handler (android.os.Handler)3 Timber (timber.log.Timber)3 Toolbar (android.support.v7.widget.Toolbar)2 View (android.view.View)2 Answers (com.crashlytics.android.answers.Answers)2 CrashlyticsCore (com.crashlytics.android.core.CrashlyticsCore)2 FlowConfig (com.raizlabs.android.dbflow.config.FlowConfig)2 Fabric (io.fabric.sdk.android.Fabric)2 SharedPreferences (android.content.SharedPreferences)1 Bundle (android.os.Bundle)1 FloatingActionButton (android.support.design.widget.FloatingActionButton)1 NavigationView (android.support.design.widget.NavigationView)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 DrawerLayout (android.support.v4.widget.DrawerLayout)1 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 RecyclerView (android.support.v7.widget.RecyclerView)1 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 RelativeLayout (android.widget.RelativeLayout)1