A reference for wiring the BugScreen bug-reporting SDK into an Android app. If you're evaluating BugScreen or setting it up for the first time, this repo shows every integration point in a working app.
A tester takes a screenshot anywhere in the app and the report screen opens. Reports include device info, your custom data, and a breadcrumb log. Testers never leave the app.
The SDK is wired into a small but complete travel app (Kotlin, Jetpack Compose / Material 3), so you can see it working in a real navigation stack. More on the demo app below.
See what a report looks like → Sample bug report is a real report filed from this app. It shows everything a tester's screenshot delivers: the annotated screenshot, the reporter's type/severity classification, full device and OS metadata, and the custom data this app attaches (
userId,plan,homeCity,sessionId). Reports can land in GitHub Issues, Jira, ClickUp, Slack, and more.
Everything BugScreen-related lives in a handful of clearly-commented spots:
| # | What | Where |
|---|---|---|
| 1 | Initialize once at startup | TravelApp.kt → BugScreenSDK.start(...) |
| 2 | Request screenshot permission (Android 13+) | MainActivity.kt → requestScreenshotPermission(...) |
| 3 | Attach user / session context | TravelApp.kt → registerSignedInUser() (setCustomData) |
| 4 | Log breadcrumbs at meaningful events | BugScreenBreadcrumbs.kt (BugScreenSDK.log) |
| 5 | Manual "Report a problem" entry point | ProfileScreen.kt → openBugReportScreen(context) |
| 6 | Exercise capture controls | ProfileScreen.kt → CaptureControls() |
Automatic screenshot detection needs no wiring beyond step 1; it's on by default.
// app/build.gradle.kts
dependencies {
debugImplementation("app.bugscreen:android:1.9.0") // full SDK in debug builds
releaseImplementation("app.bugscreen:android-no-op:1.9.0") // no-op stub in release builds
}BugScreen is a dev/QA tool. The no-op artifact exposes the same API and does nothing, so release
builds ship no bug-reporting code to production users. SDK calls use the same API in both builds.
The sample shows the capture controls in debug builds. The API key is read from local.properties and exposed via a
BUGSCREEN_API_KEY buildConfigField, so no key is committed to source control.
- Clone this repo and open it in Android Studio (latest stable), or build from the CLI.
- Add your API key. Copy the sample properties file and paste your key from the
BugScreen console:
You can leave the key blank to build and browse the Travel app. A valid app key is required to load reporter settings and upload reports; a blank or invalid key shows a settings-loading error.
cp local.properties.sample local.properties # then edit local.properties: # bugscreen.apiKey=fb_your_api_key_here
- Run the
appconfiguration on a device or emulator (Android 7.0 / API 24 or newer). - Try the headline flow: open the app and take a screenshot (Power + Volume-Down, or
adb shell input keyevent 120). The report screen opens by itself.
JDK note: this project targets JDK 17 (AGP 8.11). Android Studio's bundled JDK works out of the box. From the command line, run Gradle with a JDK 17–21 (e.g.
JAVA_HOME=<jdk17>). The compile toolchain is pinned to 17 and auto-provisioned if you don't have it installed.
In a debug build, open Profile → BugScreen capture controls. Use a physical device to try shake-to-report. Recording requires Android 10 or newer and a supported encoder.
- Floating button. Tap the floating BugScreen button to open its menu. Use Hide floating button and Show floating button to change its visibility.
- Recent recording. Select Start recent recording, then approve the system prompt. Check recording status reads the current state from the SDK. Reproduce the issue and open the reporter while recording to attach up to 15 seconds of recent video. Stop recent recording clears the rolling buffer.
- Report notification. Select Show report notification and allow notifications when asked. Pull down the notification shade over the app and tap the BugScreen notification. Use Hide report notification to remove the shortcut.
- Shake-to-report. Select Enable shake-to-report, then deliberately shake the device while the app is open. Disable shake-to-report turns the shortcut off.
TravelApp.kt opts in to
attaching available app-process logcat records. Keep secrets and personal data out of logs when
testing reports.
BugScreen Travel is a small travel-discovery app that gives the SDK a place to live. Browse destinations, save favourites, and open a trip itinerary, plus a manual "Report a problem" entry point in the profile. Built with Kotlin, Jetpack Compose (Material 3), and Navigation-Compose. All content is bundled and static, so no backend, accounts, or network are needed to run it.
| Explore | Destination | Report (automatic) | Profile |
|---|---|---|---|
| Feed of destinations | Photo, highlights, save | Opens on screenshot | Manual "Report a problem" |
app/src/main/java/app/bugscreen/example/travel/
TravelApp.kt # Application — SDK init + custom data (integration #1, #3)
MainActivity.kt # Single Activity host — permission (integration #2)
TravelViewModel.kt # App-scoped state over the repository
bugscreen/ # BugScreenBreadcrumbs — logging wrapper (integration #4)
navigation/ # Routes + bottom-nav NavHost
data/ # Static sample data + in-memory repository
ui/
explore/ detail/ saved/ trips/ profile/ # screens (#5 lives in profile/)
components/ # cards, chips, procedural HeroImage
theme/ # Material 3 colours, type, light/dark theme
- Static data. Destinations, trips, and the user are hard-coded in
SampleData.kt. - No persistence. Saved destinations live in memory and reset when the process is killed.
- No bundled photos. Destination "images" are gradients generated from each place's category
(see
ui/components/HeroImage.kt), which keeps the repo small and free of image licensing. - Reporting needs a real key. A blank or invalid
bugscreen.apiKeycannot load report settings. Add yourfb_...key to open the form and submit reports.