use of com.crashlytics.android.Crashlytics in project TeamCityApp by vase4kin.
the class TeamCityApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
// #=============== Fabric ================#//
if (!BuildConfig.DEBUG) {
Fabric.with(this, new Crashlytics());
}
// #=============== Iconify ================#//
Iconify.with(new MaterialModule()).with(new MaterialCommunityModule()).with(new FontAwesomeModule());
// #=============== Dagger ================#//
// app injector init
// net injector init
mAppInjector = DaggerAppComponent.builder().appModule(new AppModule(this)).build();
// Get default url
String mBaseUrl = mAppInjector.sharedUserStorage().getActiveUser().getTeamcityUrl();
// Rest api init
if (!TextUtils.isEmpty(mBaseUrl)) {
buildRestApiInjectorWithBaseUrl(mBaseUrl);
}
}
use of com.crashlytics.android.Crashlytics in project iNaturalistAndroid by inaturalist.
the class INaturalistApp method onCreate.
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
FacebookSdk.sdkInitialize(getApplicationContext());
AnalyticsClient.initAnalyticsClient(this);
AnalyticsClient.getInstance().logEvent(AnalyticsClient.EVENT_NAME_APP_LAUNCH);
// Build a custom Picasso instance that uses more memory for image cache (50% of free memory
// instead of the default 15%)
Picasso picasso = new Picasso.Builder(getApplicationContext()).memoryCache(new LruCache((int) (Runtime.getRuntime().maxMemory() * 0.5))).build();
Picasso.setSingletonInstance(picasso);
// Picasso.with(getApplicationContext())
// .setIndicatorsEnabled(true);
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
INaturalistApp.context = getApplicationContext();
deviceLocale = getResources().getConfiguration().locale;
applyLocaleSettings();
// Create the root offline guides directory, if needed
GuideXML.createOfflineGuidesDirectory(this);
SharedPreferences pref = getSharedPreferences("iNaturalistPreferences", MODE_PRIVATE);
String username = pref.getString("username", null);
if (username != null) {
setShownOnboarding(true);
}
int missionViewCount = getPrefs().getInt("mission_view_count", 0);
getPrefs().edit().putInt("mission_view_count", ++missionViewCount).commit();
}
use of com.crashlytics.android.Crashlytics in project Awful.apk by Awful.
the class AwfulApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
// initialise the AwfulPreferences singleton first since a lot of things rely on it for a Context
mPref = AwfulPreferences.getInstance(this, this);
appStatePrefs = this.getSharedPreferences(APP_STATE_PREFERENCES, MODE_PRIVATE);
NetworkUtils.init(this);
AndroidThreeTen.init(this);
AnnouncementsManager.init();
onPreferenceChange(mPref, null);
// work out how long it's been since the app was updated
long hoursSinceInstall = Long.MAX_VALUE;
try {
PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
long millisSinceInstall = System.currentTimeMillis() - packageInfo.lastUpdateTime;
hoursSinceInstall = TimeUnit.HOURS.convert(millisSinceInstall, TimeUnit.MILLISECONDS);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
Timber.i("App installed %d hours ago", hoursSinceInstall);
// enable Crashlytics on non-debug builds, or debug builds that have been installed for a while
crashlyticsEnabled = !BuildConfig.DEBUG || hoursSinceInstall > 4;
if (crashlyticsEnabled) {
Fabric.with(this, new Crashlytics());
Timber.plant(new CrashlyticsReportingTree());
if (mPref.sendUsernameInReport) {
Crashlytics.setUserName(mPref.username);
}
} else {
Timber.plant(new Timber.DebugTree());
}
if (Constants.DEBUG) {
Timber.d("*\n*\n*Debug active\n*\n*");
/*
This checks destroyed cursors aren't left open, and crashes (with a log) if it finds one
Really this is here to avoid introducing any more leaks, since there are some issues with
too many open cursors
*/
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().penaltyLog().penaltyDeath().build());
}
SyncManager.sync(this);
}
use of com.crashlytics.android.Crashlytics in project ButterRemote-Android by se-bastiaan.
the class OverviewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
if (!PrefUtils.contains(this, "intro")) {
Intent intent = new Intent(this, IntroActivity.class);
startActivity(intent);
finish();
}
setContentView(R.layout.activity_framelayout);
ButterKnife.bind(this);
setSupportActionBar(toolbar);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2) {
toolbar.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, getResources().getDimensionPixelSize(R.dimen.abc_action_bar_default_height_material) + PixelUtils.getStatusBarHeight(this)));
} else {
toolbar.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, getResources().getDimensionPixelSize(R.dimen.abc_action_bar_default_height_material)));
}
progressBar.setVisibility(View.GONE);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
fragmentTransaction.replace(R.id.frameLayout, new InstanceListFragment());
fragmentTransaction.commit();
}
use of com.crashlytics.android.Crashlytics in project androidApp by InspectorIncognito.
the class TranSappApplication method onCreate.
public void onCreate() {
super.onCreate();
// 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);
PreferenceManager.setDefaultValues(getApplicationContext(), R.xml.preference_screen, false);
TranSappApplication.context = getApplicationContext();
Installation.loadUserId(context);
PositionProvider.instantiate(getApplicationContext());
Mapbox.getInstance(this, "pk.eyJ1IjoidHJhbnNhcHAiLCJhIjoiY2lzdGloNmh6MDAzNjJ1dGt5ZnhyNHpucSJ9.Iz4LN0PlnCDawJLgbOywoA");
}
Aggregations