简体   繁体   中英

crash reporter offline for android device offline

I have a device android, example friendly arm and this is offline. I need to see crashes in this device. for example, crash save in sd card. can I use firebase crashlytics offline and save in file? or use other library. I need a full report, for example ram, storage, line crash, and etc.

Technically, you can implement such mechanism to track the crash logs yourself. check out the following piece of code to handle within Application class:

import android.app.Application

class TestApp : Application() {
    override fun onCreate() {
        super.onCreate()

        val exceptionHandler = SimpleExceptionHandler()
        Thread.setDefaultUncaughtExceptionHandler(exceptionHandler)
    }
}


class SimpleExceptionHandler : Thread.UncaughtExceptionHandler {
    override fun uncaughtException(thread: Thread, exc: Throwable) {
        // Log your exception here to files, database, etc together with the device status like RAM, processes, network condition that the crash point 
    }
}

You can choose the way to store your information like text file, database, etc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM