CrashX Android Library

Akshay
2 min readMar 20, 2019

Download The New Debate App [ Heatic Debate App ] Debate On Major Topics With This App.

Don’t forget to follow me on Instagram to stay up-to-date Follow Me

CrashX

This library allows launching a crash activity when the app crashes, instead of showing the hated “Unfortunately, X has stopped” dialog

Sample Screen

CrashX

How to use

One-step install

Add it in your root build.gradle at the end of repositories:

allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}

Step 2. Add the dependency

dependencies {
implementation 'com.github.TutorialsAndroid:crashx:v4.0.19'
}

…and you are done!

Of course, you can combine this library with any other crash handler such as Crashlytics, ACRA or Firebase, just set them up as you would normally.

Try it

Force an app crash by throwing an uncaught exception, using something like this in your code:

throw new RuntimeException("Kinda!");

Advanced setup

You can customize the behavior of this library in several ways by setting its configuration at any moment. However, it’s recommended to do it on your Application class so it becomes available as soon as possible.

Add a snippet like this to your Application class:

@Override
public void onCreate() {
super.onCreate();
CrashConfig.Builder.create()
.backgroundMode(CrashConfig.BACKGROUND_MODE_SILENT) //default: CrashConfig.BACKGROUND_MODE_SHOW_CUSTOM
.enabled(false) //default: true
.showErrorDetails(false) //default: true
.showRestartButton(false) //default: true
.logErrorOnRestart(false) //default: true
.trackActivities(true) //default: false
.minTimeBetweenCrashesMs(2000) //default: 3000
.errorDrawable(R.drawable.ic_custom_drawable) //default: bug image
.restartActivity(YourCustomActivity.class) //default: null (your app's launch activity)
.errorActivity(YourCustomErrorActivity.class) //default: null (default error activity)
.eventListener(new YourCustomEventListener()) //default: null
.apply();
}

See the full instructions on :

https://github.com/TutorialsAndroid/crashx

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Akshay
Akshay

Written by Akshay

📱 Android App Developer

No responses yet

Write a response