Skip to content

Apisium/appcenter-sdk-jvm

Repository files navigation

Unofficial AppCenter JVM SDK Jitpack

Allows you to use the API of AppCenter Android SDK on the desktop jvm.

Usage

build.gradle

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

dependencies {
    implementation 'com.github.Apisium:appcenter-sdk-jvm:<version>'
}

Main.java

import android.app.Application;
import com.microsoft.appcenter.analytics.Analytics;
import com.microsoft.appcenter.crashes.Crashes;
import com.microsoft.appcenter.crashes.model.TestCrashException;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        Application app = Application.getApplication(Main.class.getPackage().getName(), 1, "1.0.0");
        AppCenter.start(app, "YOUR APP SECRET", Crashes.class, Analytics.class);
        app.start();

        Analytics.trackEvent("test");
        Crashes.trackError(new TestCrashException());

        Thread.sleep(10000); // wait for the crash report to be sent
        app.close();
    }
}

Properties

Property Default Value
com.microsoft.appcenter.preferences .appcenter-preferences.json
com.microsoft.appcenter.debug false
com.microsoft.appcenter.loglevel 6
com.microsoft.appcenter.crashes.uncaughtexception.autosend false

Author

Shirasawa

License

LICENSE