Shake Reporter is An Android Library Built to Report Crashes, OkHttp Requests in Any Android Application Based on OkHttp3 Interceptor and UncaughtExceptionHandler in Any Application
Mainly This Library Built to Report Crashes and Network Calls on Release Build, Not Debuggable Build The Main Reason for this is Release Build is Reporting Crashes Without Any Crashlytics Configuration for Testing Build also Crashlytics Sometimes Take Too Much Time to Push Crashes to Crashlytics Dashboard and You want to Know what is the Exception ASAP for This Reason this Library Will show Notification Once UncaughtExceptionHandler Triggered an Exception and Clicking on the Notification will Show Screen with The History of Crashes
The Main Problem To use This Library When You create Application For Staging Build Without Crashlytics Configuration You can Use this Library To Report Crashes and Network Requests On Not Debuggable Builds (Release Builds Only)
The Library Screen is Accessible Via Icon in Launcher or Shake the Screen Feature Depends if the Shake is Enabled or Not
- Crashes History
- Http Requests Logs
- Notifications on Crashes
- Shake Screen To Open Reports Screen
- Create Report Text File in Shared Media Storage
allprojects {
repositories {
mavenCentral()
}
}
dependencies {
implementation("com.yazantarifi:shake-reporter:1.1.1")
}
- Initialize The Library To Declare Crashes Report Listener
Init has 2 Methods One to Override Default Listener and Another One to Trigger Exception if You want Additional Work
class ApplicationInstance: Application() {
override fun onCreate() {
super.onCreate()
ShakeReporter.init(this)
}
}
- Register Shake Listener
If you want To Open Screen Via Shake the Activity Add this Line in OnCreate of The Base Screen
ShakeReporter.startSensorListener(this, ShakeSensorListener(this))
- If you want To Un Register The Shake Listener add This Line to onDestroy
ShakeReporter.destroySensorListener(this, listener)
- Add Network Configuration to Track Http Requests
private fun create() : ApiRequests {
val retrofit = Retrofit.Builder()
.addConverterFactory(GsonConverterFactory.create())
.baseUrl("https://api.github.com/")
.client(OkHttpClient.Builder().addInterceptor(ReporterInterceptor()).build())
.build()
return retrofit.create(ApiRequests::class.java)
}
- RecyclerView Version : 1.2.1
- OkHttp Version : 4.9.1
- Min SDK Version Supported : 19
- Target SDK Version : 31
Feature Name | Screenshot |
---|---|
Crash Notification | |
Crashes History | |
Requests History | |
Request Info | |
Export Crashes, Requests |
Copyright (C) 2021 Shake Reporter is An Open Source Library (Licensed under the MIT License)