Skip to content

Commit

Permalink
Merge pull request #197 from elimu-ai/#177-Integrate-Crashlytics-for-…
Browse files Browse the repository at this point in the history
…crash-reporting

#177 Integrate Crashlytics for crash reporting
  • Loading branch information
jo-elimu authored Mar 25, 2018
2 parents 0defcc4 + db1523b commit 975a8b1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'
apply plugin: 'com.github.gfx.ribbonizer'
//apply plugin: 'io.fabric'

android {
compileSdkVersion 26
Expand Down Expand Up @@ -88,6 +89,8 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:3.6.0"
implementation "com.squareup.okhttp3:logging-interceptor:3.6.0"

implementation "com.crashlytics.sdk.android:crashlytics:2.9.1"

testImplementation 'junit:junit:4.12'

androidTestImplementation "com.android.support:support-annotations:$supportLibVersion"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
android:name=".synchronization.AppListActivity"
android:configChanges="orientation|screenSize"></activity>

<!--<meta-data-->
<!--android:name="io.fabric.ApiKey"-->
<!--android:value="api-key-value" />-->
</application>

</manifest>
7 changes: 7 additions & 0 deletions app/src/main/java/ai/elimu/appstore/BaseApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.util.Base64;
import android.util.Log;

import com.crashlytics.android.Crashlytics;
import com.securepreferences.SecurePreferences;

import org.greenrobot.greendao.database.Database;
Expand All @@ -23,6 +24,7 @@
import ai.elimu.appstore.service.ProgressResponseBody;
import ai.elimu.appstore.service.ProgressUpdateCallback;
import ai.elimu.appstore.util.VersionHelper;
import io.fabric.sdk.android.Fabric;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Response;
Expand Down Expand Up @@ -72,6 +74,11 @@ protected void log(int priority, String tag, String message, Throwable throwable
}
Timber.i("onCreate");

// if ("release".equals(BuildConfig.BUILD_TYPE)) {
// // Initialize Crashlytics (crash reporting)
// Fabric.with(this, new Crashlytics());
// }

// greenDAO config
CustomDaoMaster.DevOpenHelper helper = new CustomDaoMaster.DevOpenHelper(this, "appstore-db");
Database db = helper.getWritableDb();
Expand Down
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
classpath 'com.github.gfx.ribbonizer:ribbonizer-plugin:2.1.0'
classpath 'io.fabric.tools:gradle:1.25.2' // https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -23,12 +25,9 @@ allprojects {
repositories {
mavenLocal()
jcenter()
maven {
url "https://maven.google.com"
}
maven {
url "https://dl.bintray.com/elimu-ai/maven/"
}
maven { url 'https://maven.google.com' }
maven { url 'https://dl.bintray.com/elimu-ai/maven/' }
maven { url 'https://maven.fabric.io/public' }
}
}

Expand Down

0 comments on commit 975a8b1

Please sign in to comment.