Added Crashlytics

This commit is contained in:
Deniz Düzgören
2019-08-14 12:36:54 +02:00
parent 2dfa8a0407
commit 561d06aa5b
5 changed files with 20 additions and 12 deletions
+7 -3
View File
@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
android { android {
compileSdkVersion 28 compileSdkVersion 28
@@ -9,8 +10,8 @@ android {
applicationId "com.denizd.substitutionplan" applicationId "com.denizd.substitutionplan"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 23 versionCode 24
versionName "2.2.0" versionName "2.2.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
@@ -31,10 +32,11 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-beta01' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-beta01'
implementation 'org.jsoup:jsoup:1.11.3' implementation 'org.jsoup:jsoup:1.11.3'
implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta01' implementation 'androidx.recyclerview:recyclerview:1.1.0-beta02'
implementation 'com.google.android.material:material:1.1.0-alpha09' implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'com.android.support:customtabs:28.0.0' implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-messaging:19.0.1' implementation 'com.google.firebase:firebase-messaging:19.0.1'
// implementation 'androidx.core:core-ktx:1.0.2' // implementation 'androidx.core:core-ktx:1.0.2'
@@ -51,6 +53,8 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
// implementation "androidx.work:work-runtime-ktx:2.0.1" // implementation "androidx.work:work-runtime-ktx:2.0.1"
} }
@@ -1,8 +1,5 @@
package com.denizd.substitutionplan package com.denizd.substitutionplan
import android.app.job.JobInfo
import android.app.job.JobScheduler
import android.content.ComponentName
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
@@ -12,7 +9,6 @@ import android.preference.PreferenceManager
import android.util.Log import android.util.Log
import android.view.* import android.view.*
import android.widget.TextView import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.app.AppCompatDelegate
@@ -21,6 +17,7 @@ import androidx.core.widget.NestedScrollView
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction import androidx.fragment.app.FragmentTransaction
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.crashlytics.android.Crashlytics
import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
@@ -42,11 +39,17 @@ class Main : AppCompatActivity(R.layout.app_bar_main) {
val edit = prefs.edit() val edit = prefs.edit()
val firstTime = Intent(context, FirstTime::class.java) val firstTime = Intent(context, FirstTime::class.java)
val deviceName = DeviceName.with(context).request { deviceInfo, _ ->
deviceInfo.marketName
}
Crashlytics.setUserIdentifier("$deviceName, ${prefs.getString("username", "") ?: ""}")
if (prefs.getBoolean("firstTime", true)) { if (prefs.getBoolean("firstTime", true)) {
// if (true) { // if (true) {
startActivity(firstTime) startActivity(firstTime)
finish() finish()
} else { } else {
if (!prefs.getBoolean("colourTransferred", false)) { if (!prefs.getBoolean("colourTransferred", false)) {
MiscData.transferOldColourIntsToString(prefs) MiscData.transferOldColourIntsToString(prefs)
edit.putBoolean("colourTransferred", true).apply() edit.putBoolean("colourTransferred", true).apply()
+1 -1
View File
@@ -61,7 +61,7 @@
<string name="invalidCode">Ungültiger Code</string> <string name="invalidCode">Ungültiger Code</string>
<string name="experimentalMenu">Experimentalmenü</string> <string name="experimentalMenu">Experimentalmenü</string>
<string name="diagnosticsMenu">Diagnosemenü</string> <string name="diagnosticsMenu">Diagnosemenü</string>
<string name="notificationsAndSync">Benachrichtigungen und Hintergrund-Synchronisation aktivieren</string> <string name="notificationsAndSync">Kursbenachrichtigungen aktivieren</string>
<string name="noSubstitutionsForYou">Kein Entfall für dich</string> <string name="noSubstitutionsForYou">Kein Entfall für dich</string>
<string name="chineseDevicesHelp">Einige chinesische Hersteller, wie Huawei/Honor und Xiaomi, unterdrücken Hintergrund-Services, weshalb Benachrichtungen und Hintergrund-Synchronisation nicht funktionieren.\n\nIch habe feststellen müssen, dass es keine einfache Lösung dafür gibt, die ich einbauen könnte.\n\nStattdessen kannst du jedoch versuchen, App-Optimierungen für diese App zu deaktivieren:\n\nSchließe die App und öffne \"Einstellungen\" -> \"Apps\" -> \"AvH-Plan\" -> \"Akku\" -> \"App-Start\" -> \"Automatisch verwalten\" deaktivieren, \"Im Hintergrund ausführen\" aktivieren.\n\nDies kann unter Umständen keinen Einfluss haben.</string> <string name="chineseDevicesHelp">Einige chinesische Hersteller, wie Huawei/Honor und Xiaomi, unterdrücken Hintergrund-Services, weshalb Benachrichtungen und Hintergrund-Synchronisation nicht funktionieren.\n\nIch habe feststellen müssen, dass es keine einfache Lösung dafür gibt, die ich einbauen könnte.\n\nStattdessen kannst du jedoch versuchen, App-Optimierungen für diese App zu deaktivieren:\n\nSchließe die App und öffne \"Einstellungen\" -> \"Apps\" -> \"AvH-Plan\" -> \"Akku\" -> \"App-Start\" -> \"Automatisch verwalten\" deaktivieren, \"Im Hintergrund ausführen\" aktivieren.\n\nDies kann unter Umständen keinen Einfluss haben.</string>
<string name="chineseDevicesTitle">Informationen bezüglich deines Gerätes</string> <string name="chineseDevicesTitle">Informationen bezüglich deines Gerätes</string>
+1 -1
View File
@@ -34,7 +34,7 @@
<string name="seniorCourses">If you\'re in senior phase, please also tell me which courses you\'re enrolled in.</string> <string name="seniorCourses">If you\'re in senior phase, please also tell me which courses you\'re enrolled in.</string>
<string name="yourCourses">Your courses</string> <string name="yourCourses">Your courses</string>
<string name="moreSettings">Lastly, just a few more settings.</string> <string name="moreSettings">Lastly, just a few more settings.</string>
<string name="notificationsAndSync">Receive notifications and enable background sync</string> <string name="notificationsAndSync">Receive course notifications</string>
<string name="enableDarkMode">Enable dark mode</string> <string name="enableDarkMode">Enable dark mode</string>
<string name="haveFun">Have fun!</string> <string name="haveFun">Have fun!</string>
+4 -3
View File
@@ -5,15 +5,15 @@ buildscript {
repositories { repositories {
google() google()
jcenter() jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.0-beta02' classpath 'com.android.tools.build:gradle:3.5.0-beta02'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.0' classpath 'com.google.gms:google-services:4.3.0'
classpath 'io.fabric.tools:gradle:1.31.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
} }
@@ -22,6 +22,7 @@ allprojects {
google() google()
jcenter() jcenter()
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
} }
} }