Debug bundle
For debugging, the UX Framework includes an option to collect debug information and package it into a single ZIP bundle. You can then send the ZIP to your own server for further analysis. The following steps outline when this process is triggered and how to get the bundle file.
Step 1. Enable option for debug reports in the Settings UI
Under debugSettings
, set showDisplaySendDebugInfoButtonOption = true
. This will add a toggle allowing the user to enable debug reporting.
class DashApplication : Application() {
override fun onCreate() {
Dash.init(
applicationContext = applicationContext,
accessToken = getString(R.string.mapbox_access_token)
) {
debugSettings {
showDisplaySendDebugInfoButtonOption = true
}
}
}
}
Step 2. Observe when debug bundle file is ready
Add a listener to run when debug bundle file is saved locally. It is a ZIP archive with logs, screenshots, and the current UX Framework options. Use this file to send debug data to remote database for reports, or handle the file locally.
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
Dash.controller.observeDebugBundleReady().collect { file ->
// Sending report to backend
}
}
}
}
}
Step 3. Collect bug reports from users
The debug bundle ZIP file is prepared when users tap the bug icon on the main screen.
See Also
Learn how to activate button for debug info collection