Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Airbrake for your Android application #1

Open
DamsithKarunaratna opened this issue Apr 12, 2019 · 0 comments
Open

Setup Airbrake for your Android application #1

DamsithKarunaratna opened this issue Apr 12, 2019 · 0 comments
Labels

Comments

@DamsithKarunaratna
Copy link
Owner

Installation & Setup

  1. Download the Airbrake Jar or build from source via GitHub

  2. Copy the .jar file to your Android app's libs/ folder

  3. Import the AirbrakeNotifier class in your app's main Activity:

    import com.loopj.android.airbrake.AirbrakeNotifier;
  4. In your activity's onCreate function, register to begin capturing exceptions.

(You can find your project API KEY with your project's settings):

AirbrakeNotifier.register(this, "<Your project API KEY>");

Configuration

The AirbrakeNotifier.register call requires a context and Airbrake API key to be passed in, and optionally a third argument specifying the environment. The environment defaults to production if not set.

To notify Airbrake of non-fatal exceptions, or exceptions you have explicitly caught in your app, you can call AirbrakeNotifier.notify. This call takes exactly one argument, a Throwable, and can be called from anywhere in your code. For example:

try {
    // Something dangerous
} catch(Exception e) {
    // We don't want this to crash our app, but we would like to be notified
    AirbrakeNotifier.notify(e);
}

For more information please visit our official GitHub repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant