CrashBottomSheet shows a beautiful BottomSheetDialog when app crashes instead of displaying ugly app stopped working dialog.

Overview

CrashBottomSheet Library for Android

This library allows android applications to launch a nice beautiful BottomSheetDialog when app crashes instead of displaying a rude, disgusting and universally hated "Unfortunately, X App has stopped!" dialog.

Before (ugly crash dialog)

default crash dialog

After (beautiful CrashBottomSheet)

using crashbottomsheet

Minimum SDK Requirement

API

Latest Version

Latest Version Code

Gradle Setup

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

dependencies {
    implementation 'com.github.dkchalotra:crashbottomsheet:latest-version-here'
}

Maven Setup

<!-- <repositories> section of pom.xml -->
<repository>
    <id>jitpack.io</id>
   <url>https://jitpack.io</url>
</repository>

<!-- <dependencies> section of pom.xml -->
<dependency>
    <groupId>com.github.dkchalotra</groupId>
    <artifactId>crashbottomsheet</artifactId>
    <version>latest-version-here</version>
</dependency>

CrashBottomSheet - Usage

  • Create a custom Application class
public class MyCustomApplication extends Application{
    ...
}
  • Call CrashBottomSheet.register() method in either onCreate() or in default Constructor.
public class MyCustomApplication extends Application{

    public MyCustomApplication(){
        super();

        // Register here
        CrashBottomSheet.register(this);
    }

    ...

    @Override
    public void onCreate(){
        super.onCreate();

        // Or Register here
        CrashBottomSheet.register(this);
    }
}
  • That's all folks! Enjoy 😉

CrashBottomSheet - Strings and Drawable

Do not forget to override the following strings in your application's strings.xml to customize CrashBottomSheet

<!--Top title of BottomSheet which defaults to app name-->
<string name="cbs_title">@string/app_name</string>
<!--Bottom description of BottomSheet-->
<string name="cbs_description">Test App has crashed!\nPlease take a moment to report crash and help developers to improve this app.</string>
<!--Label for the Positive Button-->
<string name="cbs_btn_positive">Report</string>
<!--Label for the Negative Button-->
<string name="cbs_btn_negative">Cancel</string>
<!--Content description string for BottomSheet drawable image-->
<string name="cbs_drawable_description">Sad Panda</string>
<!--Developer Email to set in email app. DO NOT FORGET TO SET IT IF YOU USE DEFAULT EMAIL REPORT ACTION-->
<string name="cbs_report_email_to">[email protected]</string>
<!--Subject for the email report-->
<string name="cbs_report_email_subject">Crash Report</string>
<!--Toast message string if no email app is installed on device-->
<string name="cbs_toast_no_email_app">No email app found on device.</string>

To set a custom drawable image on CrashBottomSheet, create the following theme in styles.xml file of your app.

<!--Crash Bottom Sheet Drawable Style-->
<style name="CBSDrawable">
    <item name="android:src">@drawable/somedrawable</item>
</style>

CrashBottomSheet - Custom Crash Report Action

Instead of using default email report action, you can write and invoke your own action for crash report when user presses the report button in CrashBottomSheet.

To create custom crash report action you need to register CrashBottomSheet with method CrashBottomSheet.register(this, your_action_callback).

Example -

class MyCustomApplication extends Application {

    public MyCustomApplication(){
        super();

        // Register here or in onCreate()
        CrashBottomSheet.register(this, new CrashBottomSheet.onCrashReport(){
            @Override
            public void handleCrashReport(String stackTrace, DeviceInfo deviceInfo){
                // Write your custom action here to handle crash report.
                // e.g. send report to your server or log it in the file or whatever.

                // You can also use default email action here
                // But don't forget to override `cbs_report_email_to` string in app's strings.xml
                CrashBottomSheet.sendCrashEmail(
                    MyCustomApplication.this,
                    stackTrace,
                    deviceInfo);
            }
        });
    }

}

CrashBottomSheet - CrashLoop

App may enter a never ending crash loop if any exception occurs in Application class code after registering CrashBottomSheet.

To prevent App from CrashLoop CrashBottomSheet handles only those crashes which occurs after a certain time period since last crash i.e. If app is crashing frequently within a small time gap then it is possible that CrashLoop has been triggered and app is crashing continously.

By default CrashBottomSheet uses crash time gap of 3 secs but you can specify your own crash time gap by using method CrashBottomSheet.setMinCrashIntervalMs(long ms) after you call CrashBottomSheet.register() method.

CrashBottomSheet does not allow to set crash time gap value of less than 3 secs. In most of the cases default crash time gap will take care of everything.

Support ❤️

If you like this library then please join the stargazers list from this link CrashBottomSheet Stargazers.

License 📜

Copyright 2020 Dheeraj Kumar

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributions 🤝

You contribution will be welcomed to make this library better

Acknowledgement 👍

Sad Panda image used in library is taken from this link Sad Panda Vector.

It is available under Public Domain v1.0 License so there is no need to worry.

You might also like...
A plug and play ;) android library for displaying a
A plug and play ;) android library for displaying a "rate this app" dialog

Easy Rating Dialog This lib provides a simple way to display an alert dialog for rating app. Default conditions to show: User opened the app more than

See a pretty error screen when your Android app crashes
See a pretty error screen when your Android app crashes

WhatTheStack WhatTheStack is a library to make your debugging experience on Android better. It shows you a pretty error screen when your Android App c

Small library that allows the application to display a small troubleshooting guide in case of repeated app startup crashes.
Small library that allows the application to display a small troubleshooting guide in case of repeated app startup crashes.

AppSalvager What is it? AppSalvager allows you to combat the issue of repeating crashes on app startup. Failed data migration, SDKs not handling their

Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer.

AppErrorsTracking 应用异常跟踪 Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer. 为原生 FC

Pluto is a on-device debugger for Android applications, which helps in inspection of HTTP requests/responses, capture Crashes and ANRs and manipulating application data on-the-go.
Pluto is a on-device debugger for Android applications, which helps in inspection of HTTP requests/responses, capture Crashes and ANRs and manipulating application data on-the-go.

Pluto Pluto is a on-device debugger for Android applications, which helps in inspection of HTTP requests/responses, capture Crashes and ANRs and manip

Stop crashes from closing your game

CrashPatch Discord server (CLICK HERE TO GET SUPPORT) CrashPatch is a Minecraft

Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.
Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.

# Media Recorder Dialog ![](https://img.shields.io/badge/Platform-Android-brightgreen.svg) ![](https://img.shields.io/badge/Android-CustomView-blue.sv

Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.
Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.

# Media Recorder Dialog ![](https://img.shields.io/badge/Platform-Android-brightgreen.svg) ![](https://img.shields.io/badge/Android-CustomView-blue.sv

ionalert 1.3 1.6 Java Sweetalert, Dialog, Alert Dialog
ionalert 1.3 1.6 Java Sweetalert, Dialog, Alert Dialog

ionalert - Android Alert Dialog A beautiful design Android Alert Dialog, alternative of Sweet Alert Dialog based on KAlertDialog using MaterialCompone

Android loading or progress dialog widget library, provide efficient way to implement iOS like loading dialog and progress wheel
Android loading or progress dialog widget library, provide efficient way to implement iOS like loading dialog and progress wheel

ACProgressLite English Version / 中文版本 An Android loading widget library. Lite and easy to use, strong customizability. Can be used to implement 'iOS'

AlertDialog for Android, a beautiful and material alert dialog to use in your android app.
AlertDialog for Android, a beautiful and material alert dialog to use in your android app.

AlertDialog for Android, a beautiful and material alert dialog to use in your android app. Older verion of this library has been removed

SweetAlert for Android, a beautiful and clever alert dialog
SweetAlert for Android, a beautiful and clever alert dialog

Sweet Alert Dialog SweetAlert for Android, a beautiful and clever alert dialog 中文版 Inspired by JavaScript SweetAlert Demo Download ScreenShot Setup Th

Beautiful color picker dialog for Android 9+
Beautiful color picker dialog for Android 9+

Color-O-Matic Beautiful Color Picker dialog for Android 9+ based on VintageChroma by Pavel Sikun. Screenshots at the end of the file. Repository Add t

📱Android Library to implement animated, 😍beautiful, 🎨stylish Material Dialog in android apps easily.
📱Android Library to implement animated, 😍beautiful, 🎨stylish Material Dialog in android apps easily.

Material Dialogs for Android 📱 📱 Android Library to implement animated, 😍 beautiful, 🎨 stylish Material Dialog in android apps easily. 1. Material

An beautiful and easy to use dialog library for Android
An beautiful and easy to use dialog library for Android

An beautiful and easy to use dialog library for Android

Just another Quotes app with beautiful UI which shows random quotes from the internet
Just another Quotes app with beautiful UI which shows random quotes from the internet

RandomQuotes Just another Quotes app with beautiful UI which shows random quotes from the internet. Screenshots Libraries Volley Android Material API

An Android library aimed to get the beautiful CardViews that Google shows at its official design specifications
An Android library aimed to get the beautiful CardViews that Google shows at its official design specifications

MaterialList Discontinued This library will not receive any updates, as I do not have the time or knowledge to improve it. If anyone forks it and want

Using RecyclerView to display data instead of ScrollView or lInearLayout for a strong app. It replaces the ScrollView used in trackMySleep app.
Using RecyclerView to display data instead of ScrollView or lInearLayout for a strong app. It replaces the ScrollView used in trackMySleep app.

RecyclerView - SleepQualityTracker with RecyclerView app This is the toy app for Lesson 7 of the Android App Development in Kotlin course on Udacity.

HockeyApp was retired and the SDKs are deprecated. Please use App Center instead.

Version 5.2.0 HockeySDK-Android implements support for using HockeyApp in your Android applications. The following features are currently supported: C

Releases(1.0.1)
Owner
Dheeraj Kumar
Dheeraj Kumar
In-app feedback and bug reporting tool for apps.

Instabug Android SDK Instabug is an in-app feedback and bug reporting tool for mobile apps. With just a simple shake, your users or beta testers can r

Instabug 171 Dec 22, 2022
Android library that captures global crashes, so that your application never really crashes

?? NoKILL ?? Android library that captures global crashes ?? , so that your application never really crashes GIF Add to your project ?? Add it in your

Aravind Chowdary 8 Jan 3, 2023
🗨️ Beautiful Dialog is a Simple and Beautiful custom dialog

Beautiful Dialog ??️ Beautiful Dialog is a Simple and Beautiful custom dialog. Screenshots Including in your project Gradle Add below codes to your ro

Geovani Amaral 21 Jan 6, 2023
Alert Dialog - You can use this extension instead of creating a separate Alert Dialog for each Activity or Fragment.

We show a warning message (Alert Dialog) to the user in many parts of our applications. You can use this extension instead of creating a separate Alert Dialog for each Activity or Fragment. Thanks to this extension, you can create a Dialog and call it in the Activity or Fragment you want and customize the component you want.

Gökmen Bayram 0 Jan 9, 2022
Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code.

FancyGifDialog-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ...

Shashank Singhal 522 Jan 2, 2023
Make your native android Dialog Fancy. A library that takes the standard Android Dialog to the next level with a variety of styling options. Style your dialog from code.

FancyAlertDialog-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ..

Shashank Singhal 350 Dec 9, 2022
[Development stopped in 2014. Unfinished and not stable - not recommended to use.] An easy-to-use ViewPager subclass with parallax background effect for Android apps.

Development stopped in 2014 Not developed since 2014. Unfinished and not stable - not recommended to use. ParallaxViewPager An easy-to-use ViewPager s

Andras Kindler 437 Dec 29, 2022
СontextMenu library based on BottomSheetDialog written in Kotlin.

KtxMenu Description СontextMenu library based on BottomSheetDialog written in Kotlin. Example ?? Installation Add the JitPack repository to your build

nprk 1 Apr 28, 2022
A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in Flutter.

Red Screen Of Death What A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in

Ahmad Melegy 178 Dec 9, 2022
An Android library for displaying a dialog where it presents new features in the app.

WhatIsNewDialog What is new dialog for Android is used for presenting new features in the the app. It can be used in the activity starts, from menu or

NonZeroApps 22 Aug 23, 2022