Implement ACRA reporting

This commit is contained in:
William Brawner 2018-08-21 09:21:20 -05:00 committed by William Brawner
parent 110bc80424
commit ae125a5311
5 changed files with 35 additions and 5 deletions

View file

@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '26.0.2'
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 14

View file

@ -12,7 +12,7 @@ android {
exclude 'META-INF/DEPENDENCIES'
}
compileSdkVersion 27
buildToolsVersion "26.0.2"
buildToolsVersion '27.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@ -24,6 +24,9 @@ android {
versionCode 9
versionName "0.4.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "ACRA_URL", "\"$acraUrl\"" // Defined in ~/.gradle/gradle.properties
buildConfigField "String", "ACRA_USER", "\"$acraUser\"" // Defined in ~/.gradle/gradle.properties
buildConfigField "String", "ACRA_PASS", "\"$acraPass\"" // Defined in ~/.gradle/gradle.properties
}
buildTypes {
release {
@ -50,6 +53,7 @@ android {
}
ext {
acraVersion = '5.1.3'
support_version = "27.1.0"
}
@ -83,5 +87,7 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.0'
implementation "ch.acra:acra-http:$acraVersion"
samsungImplementation project(":IAP5Helper")
}

View file

@ -1,7 +1,23 @@
package com.wbrawner.simplemarkdown;
import android.app.Application;
import android.content.Context;
import org.acra.ACRA;
import org.acra.annotation.AcraCore;
import org.acra.annotation.AcraHttpSender;
import org.acra.data.StringFormat;
import org.acra.sender.HttpSender;
import static com.wbrawner.simplemarkdown.BuildConfig.ACRA_PASS;
import static com.wbrawner.simplemarkdown.BuildConfig.ACRA_URL;
import static com.wbrawner.simplemarkdown.BuildConfig.ACRA_USER;
@AcraCore(buildConfigClass = BuildConfig.class, reportFormat = StringFormat.JSON)
@AcraHttpSender(uri = ACRA_URL,
basicAuthLogin = ACRA_USER,
basicAuthPassword = ACRA_PASS,
httpMethod = HttpSender.Method.POST)
public class MarkdownApplication extends Application {
private AppComponent component;
@ -17,4 +33,12 @@ public class MarkdownApplication extends Application {
public AppComponent getComponent() {
return component;
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
// The following line triggers the initialization of ACRA
ACRA.init(this);
}
}

View file

@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

View file

@ -1,6 +1,6 @@
#Tue Nov 28 19:16:56 CST 2017
#Mon Aug 20 19:40:47 CDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip