Java Code Examples for io.fabric.sdk.android.Fabric#with()

The following examples show how to use io.fabric.sdk.android.Fabric#with() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JianShiApplication.java    From jianshi with Apache License 2.0 6 votes vote down vote up
@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()
  );
}
 
Example 2
Source File: Application.java    From android-mvp-starter with MIT License 6 votes vote down vote up
@Override
public  void onCreate(){
    super.onCreate();

    //di
    component = DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(this)).build();

     //Crashlytics
    CrashlyticsCore core = new CrashlyticsCore.Builder()
            .disabled(BuildConfig.DEBUG)
            .build();

    Fabric.with(this, new Crashlytics.Builder().core(core).build());

    if (BuildConfig.DEBUG) {
        Timber.plant(new Timber.DebugTree());
    } else {
        Timber.plant(new CrashReportTree());
    }
}
 
Example 3
Source File: RegistrationActivity.java    From Password-Storage with MIT License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fabric.with(this, new Crashlytics());
    setContentView(R.layout.activity_registration);
    auth = FirebaseAuth.getInstance();
    appStatus=new AppStatus(getApplicationContext());
    register = (Button) findViewById(R.id.btn_register);
    existinguser = (Button) findViewById(R.id.existinguser);
    edt_Password = (EditText) findViewById(R.id.edt_Rpassword);
    edt_RePassword = (EditText) findViewById(R.id.edt_RRepassword);
    edt_Email = (EditText) findViewById(R.id.edt_email);
    progressBar=(ProgressBar)findViewById(R.id.progressBar);
    register.setOnClickListener(this);
    existinguser.setOnClickListener(this);
}
 
Example 4
Source File: BaseActivity.java    From KernelAdiutor with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    // Don't initialize analytics with debug build
    if (!BuildConfig.DEBUG) {
        Fabric.with(this, new Crashlytics());
    }

    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    Utils.DARK_THEME = Themes.isDarkTheme(this);
    Themes.Theme theme = Themes.getTheme(this, Utils.DARK_THEME);
    if (Utils.DARK_THEME) {
        AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
    } else {
        AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
    }
    setTheme(theme.getStyle());
    super.onCreate(savedInstanceState);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && setStatusBarColor()) {
        Window window = getWindow();
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(statusBarColor());
    }
}
 
Example 5
Source File: ApplicationController.java    From amiibo with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics(), new Answers());

    _updated = false;
    setInUpdate(false);

    //init the database orm
    FlowManager.init(this);

    //init the AmiiboHelper
    AmiiboHelper.init();

    mApplicationBus = EventBus.builder().build();

    mApplicationBus.register(this);

    AmiitoolFactory.getInstance().init(this);
}
 
Example 6
Source File: CathodeInitProvider.java    From cathode with Apache License 2.0 6 votes vote down vote up
@Override public boolean onCreate() {
  if (BuildConfig.DEBUG) {
    Timber.plant(new Timber.DebugTree());

    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
    StrictMode.setThreadPolicy(
        new StrictMode.ThreadPolicy.Builder().detectAll().permitDiskReads().penaltyLog().build());
  } else {
    Fabric.with(getContext(), new Crashlytics());
    Timber.plant(new CrashlyticsTree());
  }

  ((CathodeApp) getContext().getApplicationContext()).ensureInjection();
  AndroidInjection.inject(this);

  UpcomingSortByPreference.init(getContext());
  UpcomingTimePreference.init(getContext());
  FirstAiredOffsetPreference.init(getContext());

  Upgrader.upgrade(getContext());

  Accounts.setupAccount(getContext());

  return true;
}
 
Example 7
Source File: PalmApp.java    From OmniList with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());

    mInstance = this;

    MultiDex.install(this);

    Colorful.init(this);

    /*
     * Enable stetho only in debug mode. */
    if (BuildConfig.DEBUG) {
        Stetho.initializeWithDefaults(this);
    }

    AlarmsManager.init(getApplicationContext());

    WakeLockManager.init(getApplicationContext(), false);
}
 
Example 8
Source File: AppController.java    From homeassist with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    mInstance = this;

    mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    if (BuildConfig.DEBUG) {
        FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
                .setDeveloperModeEnabled(BuildConfig.DEBUG)
                .build();
        mFirebaseRemoteConfig.setConfigSettings(configSettings);
    }
    mFirebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);
    fetchFirebaseConfig();

    //String android_id = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
    //Crashlytics.log(Log.DEBUG, "YouQi", "");

    if (BuildConfig.DEBUG) {
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build());
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build());
    }

}
 
Example 9
Source File: ProjectApp.java    From sms-ticket with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    if (!isDebugBuild()) {
        Fabric.with(this, new Crashlytics());
    }
}
 
Example 10
Source File: MainActivity.java    From block-this with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fabric.with(this, new Answers(), new Crashlytics());
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
            this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);

    if (Build.VERSION.SDK_INT<21) {
        Menu nav_menu = navigationView.getMenu();
        nav_menu.findItem(R.id.nav_whitelist).setVisible(false);
    }

    WVersionManager versionManager = new WVersionManager(this);
    versionManager.setVersionContentUrl("https://block-this.com/version.txt");
    versionManager.setUpdateUrl("https://block-this.com/block-this-latest.apk");
    versionManager.setDialogCancelable(false);
    versionManager.setReminderTimer(720);
    versionManager.setIgnoreThisVersionLabel(""); //make button invisible
    versionManager.checkVersion();

    //Initiate shared preferences
    sharedPreferences = this.getSharedPreferences("com.savageorgiev.blockthis", Context.MODE_PRIVATE);
    displaySelectedScreen(R.id.nav_home);
}
 
Example 11
Source File: App.java    From twittererer with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();

    JodaTimeAndroid.init(this);

    Fabric.with(this, new Crashlytics());
    Twitter.initialize(new TwitterConfig.Builder(this).twitterAuthConfig(new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET)).build());

    applicationComponent = DaggerApp_ApplicationComponent.builder()
            .applicationModule(new ApplicationModule(this))
            .build();
}
 
Example 12
Source File: Home.java    From NightWatch with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fabric.with(this, new Crashlytics());
    prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    checkEula();
    new IdempotentMigrations(getApplicationContext()).performAll();

    startService(new Intent(getApplicationContext(), DataCollectionService.class));
    PreferenceManager.setDefaultValues(this, R.xml.pref_general, false);
    PreferenceManager.setDefaultValues(this, R.xml.pref_bg_notification, false);

    preferenceChangeListener = new OnSharedPreferenceChangeListener() {
        @Override
        public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
            invalidateOptionsMenu();
        }
    };

    prefs.registerOnSharedPreferenceChangeListener(preferenceChangeListener);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        Intent intent = new Intent();
        String packageName = getPackageName();
        Log.d(this.getClass().getName(), "Maybe ignoring battery optimization");
        PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
        if (!pm.isIgnoringBatteryOptimizations(packageName) &&
                !prefs.getBoolean("requested_ignore_battery_optimizations", false)) {
            Log.d(this.getClass().getName(), "Requesting ignore battery optimization");

            prefs.edit().putBoolean("requested_ignore_battery_optimizations", true).apply();
            intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
            intent.setData(Uri.parse("package:" + packageName));
            startActivity(intent);
        }
    }
}
 
Example 13
Source File: ComposeActivity.java    From sharelock-android with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fabric.with(this, new Crashlytics());
    setContentView(R.layout.activity_compose);

    Toolbar toolbar = (Toolbar) findViewById(R.id.sharelock_toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle(null);

    bus = EventBus.getDefault();
    handler = new Handler();

    Intent intent = getIntent();
    String action = intent.getAction();
    String type = intent.getType();

    String sharedText = null;
    if (Intent.ACTION_SEND.equals(action) && type != null) {
        if ("text/plain".equals(type)) {
            sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
        }
    }

    if (savedInstanceState == null) {
        final SecretInputFragment fragment = new SecretInputFragment();
        if (sharedText != null) {
            Bundle arguments = new Bundle();
            arguments.putString(SecretInputFragment.SECRET_INPUT_FRAGMENT_SECRET_ARGUMENT, sharedText);
            fragment.setArguments(arguments);
        }
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.sharelock_compose_container, fragment)
                .commit();
    } else {
        secret = savedInstanceState.getParcelable(COMPOSE_CREATED_SECRET);
    }
}
 
Example 14
Source File: Woodmin.java    From Woodmin with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());

    Picasso.Builder picassoBuilder = new Picasso.Builder(getApplicationContext());
    Picasso picasso = picassoBuilder.build();
    //picasso.setIndicatorsEnabled(true);
    try {
        Picasso.setSingletonInstance(picasso);
    } catch (IllegalStateException ignored) {
        Log.e(LOG_TAG, "Picasso instance already used");
    }
}
 
Example 15
Source File: FaveoApplication.java    From faveo-helpdesk-android-app with Open Software License 3.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    MultiDex.install(this);
    //AndroidNetworking.initialize(getApplicationContext());
    Fabric.with(this, new Crashlytics());
    instance = this;
    new Prefs.Builder()
            .setContext(this)
            .setMode(ContextWrapper.MODE_PRIVATE)
            .setPrefsName(getPackageName())
            .setUseDefaultSharedPreference(true)
            .build();
}
 
Example 16
Source File: MainActivity.java    From Prodigal with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fabric.with(this, new Crashlytics());
    setContentView(R.layout.activity_main);
    backgroundImage = (ImageView) findViewById(R.id.id_album_background);
    windowSize = new Point();
    getWindow().getWindowManager().getDefaultDisplay().getSize(windowSize);

    VibrateUtil.getStaticInstance(this);
    MediaLibrary.getStaticInstance(this);
    ResUtil.getInstance(this);
    UserDefaults ud = UserDefaults.getStaticInstance(this);

    wheelView = (WheelView) findViewById(R.id.id_wheel_view);

    permissionGranted = false;
    requestPermission();

    initOnButtonListener();

    startService();

    dumper = AIDLDumper.getInstance(this);

    if (ud.shouldShowIntro()) {
        Intent intent = new Intent(this, BDIntroActivity.class);
        startActivity(intent);
    }

    loadTheme();

}
 
Example 17
Source File: GuardaApp.java    From guarda-android-wallets with GNU General Public License v3.0 4 votes vote down vote up
@Override
    public void onCreate() {
        super.onCreate();
        context = this;
        context_s = this;
        appComponent = buildAppComponent();
        registerActivityLifecycleCallbacks(this);
        sharedManager = new SharedManager();

        String packageName = getApplicationContext().getPackageName();
        Log.d("flint", "GuardaApp.onCreate()... packageName: " + packageName);
        if ("com.guarda.dct".equals(packageName)) {
            // buy - это покупка, purchase - обменник
//            SharedManager.flag_disable_buy_menu = true;
//            SharedManager.flag_disable_purchase_menu = true;
            SharedManager.flag_create_new_wallet_screen = true;
        } else if ("com.guarda.etc".equals(packageName)) {
            SharedManager.flag_etc_eth_private_key_showing_fix = true;
        } else if ("com.guarda.ethereum".equals(packageName)) {
            SharedManager.flag_etc_eth_private_key_showing_fix = true;
        } else if ("com.guarda.clo".equals(packageName)) {
            SharedManager.flag_etc_eth_private_key_showing_fix = true;
        } else if ("com.guarda.bts".equals(packageName)) {
            SharedManager.flag_create_new_wallet_screen = true;
        }
        // [initially both are disabled. check and enable function is placed in CurrencyListHolder.castResponseCurrencyToCryptoItem]
        SharedManager.flag_disable_buy_menu = false; // !!! since we have 3 exchange services, make buy menu initially enabled
        //SharedManager.flag_disable_purchase_menu = true;
        SharedManager.flag_disable_purchase_menu = false; // !!! since we have two exchange services, changelly's check for exchange activity was disabled

        if ("com.guarda.clo".equals(packageName)) {
            SharedManager.flag_disable_buy_menu = true;
        }
        try {
            /////////////////
            // chinese crutch: force java lazy initialization of SecurePreferences, it's needed for old versions of android
            SecurePreferences.setValue("chinese_crutch_key", "chinese_crutch_value");
            SecurePreferences.setValue("chinese_crutch_key", "");
            // chinese crutch
            /////////////////
        } catch (Exception e) {
            Log.d("psd", "SecurePreferences doesn't support or something else - " + e.getMessage());
            e.printStackTrace();
            //for devices that are not support SecurePreferences
            sharedManager.setIsSecureStorageSupported(false);
        }
        if ("com.guarda.btc".equals(packageName) ||
                "com.guarda.bch".equals(packageName) ||
                "com.guarda.btg".equals(packageName) ||
                "com.guarda.ltc".equals(packageName) ||
                "com.guarda.sbtc".equals(packageName) ||
                "com.guarda.dgb".equals(packageName) ||
                "com.guarda.kmd".equals(packageName) ||
                "com.guarda.bts".equals(packageName) ||
                "com.guarda.qtum".equals(packageName)) {
            sharedManager.setHasWifXprvKeys(true);
        }


        ShapeshiftManager.getInstance().updateSupportedCoinsList(null);

        FreshchatConfig freshchatConfig = new FreshchatConfig(Const.FRESHCHAT_APP_ID, Const.FRESHCHAT_APP_KEY);
        freshchatConfig.setGallerySelectionEnabled(true);
        Freshchat.getInstance(getApplicationContext()).init(freshchatConfig);

        Map<String, String> userMeta = new HashMap<>();
        userMeta.put("packageName", packageName);
        userMeta.put("platform", "android");
        Freshchat.getInstance(getApplicationContext()).setUserProperties(userMeta);

        FirebaseCrash.setCrashCollectionEnabled(!BuildConfig.DEBUG);

        // Set up Crashlytics, disabled for debug builds
        Crashlytics crashlyticsKit = new Crashlytics.Builder()
                .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
                .build();
        // Initialize Fabric with the debug-disabled crashlytics.
        Fabric.with(this, crashlyticsKit);
    }
 
Example 18
Source File: AppLifecycleCallbacks.java    From Qiitanium with MIT License 4 votes vote down vote up
protected void setupFabric() {
  Fabric.with(app, new Crashlytics());
}
 
Example 19
Source File: EventSender.java    From Anecdote with Apache License 2.0 4 votes vote down vote up
public EventSender(Context context) {
    Fabric.with(context, new Crashlytics());
}
 
Example 20
Source File: LoginMaster.java    From uPods-android with Apache License 2.0 4 votes vote down vote up
private void initTwitter() {
    TwitterAuthConfig authConfig = new TwitterAuthConfig(Config.TWITTER_CONSUMER_KEY, Config.TWITTER_CONSUMER_SECRET);
    Fabric.with(UpodsApplication.getContext(), new Twitter(authConfig));
}