Skip to content

jorexdeveloper/android-exceptions-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANDROID APP EXCEPTIONS HANDLER

Program to handle and view details of all uncaught exceptions in android applications. An easy way to handle, view, share, and report app crashes quickly on android, with or without any prior developer knowledge.

FEATURES

  • Instantly view, share, copy or save crash log.
  • Detailed information in crash log.
  • Include developer emails when sending crash log.
  • User friendly.

CRASH LOG INFORMATION

  • Device Information
  • App Information
  • Crash date and time
  • Activity lifecycle traces
  • Stack trace with suppressed exceptions

SCREENSHOTS

img img

DOWNLOADS

Ext Size Link
ZIP 285.60KB EH-1.0.zip
TAR.GZ 277.44KB EH-1.0.tar.gz

You can also download the test apk from below.

Ext Size Link
APK 22.0KB EHTest-1.0.apk

INSTALLATION

All you have to do is download and extract the zip (from above), then follow the below steps to add the library to your project.

Extract the zip and copy the folder EH-1.0 to your project's libs directory (.../YourProject/app/libs), then add the library as a dependency in your application/module build.gradle file (.../YourProject/app/build.gradle).

dependencies {
  api project(':app:libs:EH-1.0:eh')
}

USAGE

Initialize EH in your Application with a new EH.Builder instance, passing to it the application Context...

// import the class

import com.cyberking.developer.eh.EH;

public class MyApplication extends Application {

    @Override
    public void onCreate () {

        // Create new Builder instance passing to it the application context

        new EH.Builder (this)
            .init (); // Initialize EH

        super.onCreate ();
    }
}

or in Activity as...

// import the class

import com.cyberking.developer.eh.EH;

public class MyActivity extends Activity {

    @Override
    public void onCreate (Bundle savedInstanceState) {

        // Create new Builder instance passing to it the application context

        new EH.Builder (getApplicationContext ())
            .init (); // Initialize EH

        super.onCreate (savedInstanceState);
    }
}

CONSTRUCTORS

public EH.Builder (Context appContext)

METHODS

Use these methods to set configurations for EH before call to init ().

public EH.Builder enable (boolean enable)

Default Value : true

Enable/disable EH. If disabled, exceptions are forwarded to the Default Uncaught Exception Handler that was present before call to init ().

public EH.Builder runInBackground (boolean runInBackground)

Default Value : true

Whether EH should run when app is stopped i.e after call to onStop ().

public EH.Builder addSuppressed (boolean add)

Default Value : true

Whether to include suppressed exceptions in the crash log.

public EH.Builder setMaxActivityLogs (int max)

Default Value : 100

Set the maximum number of activity lifecycle logs/traces to include in the crash log. The last max logs are included in the log.

public EH.Builder setMaxStackTraceSize (int size)

Default Value : 100

Set the maximum number of stack traces to include in the crash log. The first size stack traces are included in the log.

public EH.Builder addEmailAddresses (String... emailAddresses)

Default Value : none

Add email addresses included in the Intent used to forward/send crash log to developers.

public void init ()

Initialize/set up EH with the configurations above.

Tip : You can change the configurations for EH after call to init () by creating a new EH.Builder instance or use the old one, then initializing it with the new configurations and making another call to init ().

EXAMPLES

// import the class

import com.cyberking.developer.eh.EH;

public class MyApplication extends Application {
    @Override public void onCreate() {
    
    // Create new Builder passing application context, then setting configurations and initializing EH
    
    new EH.Builder (this)
        .enable (true)
        .runInBackground (true)
        .setMaxActivityLogs (50)
        .setMaxStackTraceSize (50)
        .addEmailAddresses ("email0@gmail.com", "email1@gmail.com", "email2@gmail.com")
        .init ();
    }
}

NOTE : DO NOT FORGET TO MAKE A CALL TO THE METHOD init () OR EH WILL NOT RUN AND YOUR APPLICATIONS WILL CRASH NORMALLY.

LICENSE

    Copyright © 2021 Jore

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.