https://github.com/bobbyesp/crashy
A crash handler for Android powered by Material 3 and Jetpack Compose
https://github.com/bobbyesp/crashy
android-library crash-handler jetpack-compose material-3
Last synced: 6 months ago
JSON representation
A crash handler for Android powered by Material 3 and Jetpack Compose
- Host: GitHub
- URL: https://github.com/bobbyesp/crashy
- Owner: BobbyESP
- Created: 2024-04-07T09:40:47.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T11:20:02.000Z (about 2 years ago)
- Last Synced: 2025-01-18T05:14:20.736Z (over 1 year ago)
- Topics: android-library, crash-handler, jetpack-compose, material-3
- Language: Kotlin
- Homepage:
- Size: 110 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crashy
## Quick setup
### 1. Add the library
You first have to add the library to your Android project. For this you have to add `Jitpack` to your repositories
- In the `build.gradle.kts` at project level
```kotlin
allprojects {
repositories {
maven("https://jitpack.io")
}
}
```
- In the `build.gradle.kts` at module/app level
```kotlin
dependencies {
// ...
implementation("com.github.BobbyESP:Crashy:")
}
```
### 2. Setup the crash handler
First, for being able to catch any non-caught exceptions you will have to create a class extending the `Application` class from Android
For this create, for example in the root folder of your app module source a class called `App`:
```kotlin
class App: Application() {
override fun onCreate() {
super.onCreate()
}
}
```
And now that you have the file like that, just leaves calling the `setupCrashHandler()` function in the `onCreate()` function
```kotlin
class App: Application() {
override fun onCreate() {
super.onCreate()
setupCrashHandler()
}
}
```
### 3. Adding the needed to the app manifest
The only changes that you have to do in your manifest for the library to work are:
```xml
```
And done!