Commit 6556f924 authored by deregges's avatar deregges

Added Crashlytics

parent 8ad36962
apply plugin: 'com.android.application'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'kotlin-android'
dependencies {
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.27.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
......@@ -36,6 +54,7 @@ dependencies {
// design
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "com.xw.repo:bubbleseekbar:3.19"
// Splitties
implementation "com.louiscad.splitties:splitties-appctx:$splitties_version"
......@@ -45,7 +64,11 @@ dependencies {
implementation "com.louiscad.splitties:splitties-toast:$splitties_version"
implementation "com.louiscad.splitties:splitties-resources:$splitties_version"
implementation "com.louiscad.splitties:splitties-views-design:$splitties_version"
implementation "com.xw.repo:bubbleseekbar:3.19"
// etc
compile('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
transitive = true
}
}
configurations {
......
......@@ -3,6 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="io.ender.pathchaser">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="false"
android:label="@string/appname"
......@@ -38,6 +40,10 @@
android:theme="@style/GameTheme"
android:screenOrientation="portrait" />
<meta-data
android:name="io.fabric.ApiKey"
android:value="7ff5fb645f4cfe35fd429ac3f41d3aa5b36d0b30"/>
</application>
</manifest>
\ No newline at end of file
package io.ender.pathchaser
import android.util.Log
import io.ender.pathchaser.util.Constants
class GameThread(private val game: Game) : Thread() {
......
package io.ender.pathchaser
import android.util.Log
import com.crashlytics.android.Crashlytics
@Suppress("unused", "MemberVisibilityCanBePrivate")
object Log {
private const val TAG = "pathchaser"
fun i(message: String, e: Throwable? = null) = i(TAG, message, e)
fun i(tag: String = TAG, message: String, e: Throwable? = null) = Log.i(tag, message, e)
fun w(message: String, e: Throwable? = null) = w(TAG, message, e)
fun w(tag: String = TAG, message: String, e: Throwable? = null) = Log.w(tag, message, e)
fun d(message: String, e: Throwable? = null) = d(TAG, message, e)
fun d(tag: String = TAG, message: String, e: Throwable? = null) = Log.d(tag, message, e)
/**
* creates default exception when not given
*/
fun e(message: String, e: Throwable? = null) = e(TAG, message, e)
fun e(tag: String = TAG, message: String, e: Throwable? = null) {
val ex = e
?: Exception(message).apply { stackTrace = stackTrace.copyOfRange(1, stackTrace.size) }
if (!BuildConfig.DEBUG) {
Crashlytics.log(Log.ERROR, tag, message)
Crashlytics.logException(ex)
}
Log.e(tag, message, ex)
}
}
......@@ -2,15 +2,18 @@ package io.ender.pathchaser.menu
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.crashlytics.android.Crashlytics
import io.ender.pathchaser.GameActivity
import io.ender.pathchaser.R
import io.ender.pathchaser.util.Utils
import io.ender.pathchaser.util.startActivity
import io.fabric.sdk.android.Fabric
import kotlinx.android.synthetic.main.a_mainmenu.*
class MainMenu : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Fabric.with(this, Crashlytics())
setContentView(R.layout.a_mainmenu)
btnStart.setOnClickListener {
......
package io.ender.pathchaser.paths
import android.graphics.Canvas
import android.graphics.Matrix
import android.graphics.PointF
import android.graphics.Region
import android.util.Log
import io.ender.pathchaser.util.Constants
import io.ender.pathchaser.Game
import io.ender.pathchaser.Log
import io.ender.pathchaser.Player
import io.ender.pathchaser.collectibles.*
import io.ender.pathchaser.enemys.Enemy
import io.ender.pathchaser.util.Constants
import java.io.Serializable
class PathManager(val game: Game) : Serializable {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment