Buglife is an awesome bug reporting SDK & web platform for Android apps. Here's how it works:
- User takes a screenshot, or stops screen recording
- User annotates their screenshot & writes feedback
- Bug reports are pushed to your team's email/Jira/Slack/Asana/wherever you track bugs.
You can also find Buglife for iOS here.
Main Features | |
---|---|
👤 | Free + no account required |
📖 | Open source |
🏃🏽♀️ | Fast & lightweight |
🎨 | Themeable |
📩 | Automatic caching & retry |
🎥 | Screen recording |
📜 | Custom form fields, with pickers & multiline text fields |
ℹ️ | Advanced logging, with debug / info / warning levels |
📎 | Custom attachments, including JSON & SQLite support |
-
Add
buglife-android
as a dependency to your app'sbuild.gradle
. You'll also need to add Android Volley if you haven't already.dependencies { implementation 'com.buglife.sdk:buglife-android:1.3.4' }
-
Create an
Application
subclass in your project if you don't already have one. (And don't forget to add it to your app'sAndroidManifest.xml
.) -
Add the following lines to the end of the
onCreate()
method in your app'sApplication
subclass:Buglife.initWithEmail(this, "[email protected]"); Buglife.setInvocationMethod(InvocationMethod.SCREENSHOT);
Be sure to replace
[email protected]
with your own email address; this is where bug reports will be sent to.If you have a Buglife account already, you should initialize Buglife with your team's API key instead of your email:
Buglife.initWithApiKey(this, "YOUR_API_KEY"); Buglife.setInvocationMethod(InvocationMethod.SCREENSHOT);
-
Build & run on a device; take a screenshot to report a bug!
-
Submit a bug report from your device, then check your email for a link to the Buglife web dashboard!
There are 2 different ways to invoke the bug reporter, enumerated by Buglife.InvocationMethod:
-
SHAKE
: Invokes when the user shakes their device.Buglife.setInvocationMethod(InvocationMethod.SHAKE);
-
SCREENSHOT
: Invokes when the user manually takes a screenshot with their device.Buglife.setInvocationMethod(InvocationMethod.SCREENSHOT);
-
NONE
: Disables all except manual invocations.Buglife.setInvocationMethod(InvocationMethod.NONE);
This may be preferable for production builds. In this case, we recommend embedding a hidden button somewhere in your app which manually presents the bug reporter, so that you can still collect logs & other information.
For both automatic invocations (SHAKE
and SCREENSHOT
), a screenshot of the current activity is captured & attached to the bug report draft.
We recommend using the screenshot invocation for most apps. Taking screenshots to report feedback comes naturally to most users, and screenshots are still saved to the user's device as expected.
You can manually present the bug reporter activity using:
Buglife.showReporter();
Unlike the SHAKE
& SCREENSHOT
invocations, manually presenting the bug reporter activity does not automatically capture & attach a screenshot to the bug report draft.
This is useful for situations where attaching a screenshot of the immediate application state doesn't make sense (for example, if you have a "Report Bug" option in your app's settings screen).
You can capture a screenshot of your app at any moment using Buglife.getScreenshotBitmap()
. You can then create an Attachment object from the generated bitmap, and add this to your bug report draft using the Buglife.addAttachment()
method. For example:
// Capture a screenshot of the current activity
Bitmap screenshot = Buglife.getScreenshotBitmap();
// Create an Attachment object with the generated screenshot
Attachment attachment = new Attachment
.Builder("Screenshot.png", Attachment.TYPE_PNG)
.build(screenshot);
// Queue the Attachment for the next bug report draft
Buglife.addAttachment(attachment);
// Show the bug reporter activity. This will include the queued attachment
Buglife.showReporter();
If your application stores a user’s email address, then typically you should simply set the user’s email address shortly after initializing Buglife:
String email = /** Current user's email */
Buglife.setUserEmail(email);
Alternatively, you may set a string representing the user’s name, database ID or other identifier:
String username = /** Current username */
Buglife.setUserIdentifier(username);
You can include custom attributes (i.e. key-value pairs) to your bug reports, as such:
Buglife.putAttribute("Artist", "2Pac");
Buglife.putAttribute("Song", "California Love");
To clear an attribute, set its value to null.
Buglife.putAttribute("Artist", null);
Buglife can be used to record a user's screen, and attach the recording to a bug report. Screen recording is initiated programmatically, like such:
Buglife.startScreenRecording();
Here's how the complete screen recording flow works:
- The screen recording flow is initiated using
Buglife.startScreenRecording();
- The user is shown an OS-level prompt requesting permission to record the screen.
- Once granted, Buglife immediately begins recording the screen.
- Screen recording will progress for up to 30 seconds. If the user wishes to stop screen recording earlier, they may do so by tapping the floating Record button.
- The Buglife reporter UI is automatically shown with the recording attached.
Check out the Buglife Android guide for configuration & customization options.
Copyright (C) 2018 Buglife, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.