Skip to content

CrashOps/Android-SDK

Repository files navigation

CrashOps Android SDK

License: MIT

This library will help you monitor your Android app's crashes.

Installation

🔌 & ▶️

Install via gradle

Using the plain and common maven

In your app-level "build.gradle" file, put:

   dependencies {
        implementation 'com.crashops.sdk:crashops:0.3.02'
   }

Using "jitpack.io"

In your root-level "build.gradle" file, put:

    allprojects {
        repositories {
            jcenter()
            maven { url "https://jitpack.io" }
        }
   }

In your app-level "build.gradle" file, put:

   dependencies {
        implementation 'com.github.CrashOps:Android-SDK:0.3.02'
   }

Usage

Set Application Key

To recognize your app in CrashOps servers you need an application key, you can set it via code (programmatically) either via config file.

Set an application key via code

// Kotlin
CrashOps.getInstance().setAppKey("app's-key-received-from-CrashOps-console")
// Java (pretty much like Kotlin 🙂)
CrashOps.getInstance().setAppKey("app's-key-received-from-CrashOps-console");

Set an application key via config file

Use the crashops_config.xml file and place it in the values folder.

How do I turn CrashOps off / on?

By default, CrashOps is enabled and it runs automatically as your app runs (plug n' play) but you always can control and enable / disable its behavior with two approaches: dynamically or statically.

Dynamically: Programmatically call the method disable() / enable() as demonstrated here:

// Kotlin
CrashOps.getInstance().disable()
// OR:
CrashOps.getInstance().enable()
// Java (pretty much like Kotlin 🙂)
CrashOps.getInstance().disable();
// OR:
CrashOps.getInstance().enable();

Statically: Add a crashops_config.xml file to your values folder and the SDK will read it in every app launch (using this approach may still be overridden by the dynamic approach). Do you wish to set different values for debug / release ? use Android flavors.

Acknowledgments

We're using retrofit to upload our log files.