add appcenter to android for analytics

This commit is contained in:
2019-08-11 21:57:14 +02:00
parent 40e01ba1db
commit 5ec77d4cc0
3 changed files with 19 additions and 1 deletions

View File

@@ -25,6 +25,12 @@ allprojects {
apply plugin: "com.android.application" apply plugin: "com.android.application"
apply plugin: "com.gladed.androidgitversion" apply plugin: "com.gladed.androidgitversion"
dependencies {
def appCenterSdkVersion = '2.2.0'
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
}
def getCurrentFlavor() { def getCurrentFlavor() {
Gradle gradle = getGradle() Gradle gradle = getGradle()
@@ -59,7 +65,7 @@ def outpath = "src/main/cpp"
def ver_branch = "git rev-parse --abbrev-ref HEAD".execute().text.trim() def ver_branch = "git rev-parse --abbrev-ref HEAD".execute().text.trim()
def ver_hash = "git log --pretty=format:%h -n 1".execute().text.trim() def ver_hash = "git log --pretty=format:%h -n 1".execute().text.trim()
def ver_count = Integer.parseInt("git rev-list --count HEAD".execute().text.trim()) def ver_count = Integer.parseInt("git rev-list --count HEAD".execute().text.trim())
def ver_tag = "git describe --tags --abbrev=0".execute().text.trim() def ver_tag = "git describe --tags --abbrev=0".execute().text.trim().split("-")[0]
println classpath println classpath

View File

@@ -1,6 +1,16 @@
package com.omixlab.panopainter; package com.omixlab.panopainter;
import android.app.NativeActivity; import android.app.NativeActivity;
import android.os.Bundle;
import com.microsoft.appcenter.AppCenter;
import com.microsoft.appcenter.analytics.Analytics;
import com.microsoft.appcenter.crashes.Crashes;
public class PlatformActivity extends NativeActivity { public class PlatformActivity extends NativeActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppCenter.start(getApplication(), "ce4270ce-3c74-4455-b67f-ab991b682d10", Analytics.class, Crashes.class);
}
} }

View File

@@ -51,6 +51,8 @@ void App::crash_test()
#elif defined(_WIN32) #elif defined(_WIN32)
__debugbreak(); __debugbreak();
#elif defined(__ANDROID__) #elif defined(__ANDROID__)
int *x = nullptr; *x = 42;
LOG("%d", *x);
#endif #endif
} }