Manual invocation

Report view

In addition to detection of shake gesture or launching with notification bar item, report view can be trigger programmatically:

!Java

Bugsee.showReportDialog();

// or pre-fill some fields, user will be able to modify them
Bugsee.showReportDialog("Pre-filled summary", "Pre-filled description", IssueSeverity.Blocker);

!Kotlin

Bugsee.showReportDialog()

// or pre-fill some fields, user will be able to modify them
Bugsee.showReportDialog("Pre-filled summary", "Pre-filled description", IssueSeverity.Blocker)

Issue create

You can build your own custom UI for collecting summary, description and severity from a user and use the following call to send resulting report to Bugsee.

!Java

Bugsee.upload("Upload summary", "Upload description", IssueSeverity.High);

// or, if you want, you can provide the list of labels which will be
// attached to the bug report
ArrayList<String> labels = new ArrayList<String>();
Bugsee.upload("Upload summary", "Upload description", IssueSeverity.High, labels);

!Kotlin

Bugsee.upload("Upload summary", "Upload description", IssueSeverity.High)

// or, if you want, you can provide the list of labels which will be
// attached to the bug report
val labels = ArrayList<String>()
Bugsee.upload("Upload summary", "Upload description", IssueSeverity.High, labels)

Note: You should not use it for reporting errors automatically from within code, use non-fatal errors for this instead.

If you want to stop recording before showing custom report UI, it can be done the following way.

!Java

// Stop recording.
Bugsee.stop();

// Get report to fill.
ExtendedReport report = Bugsee.createReport();

// Fill report in a custom UI.
report.setSummary("UI is broken");
report.setDescription("It happened when I pressed the button.");
Bitmap screenshot = report.getScreenshot();
// Annotate screenshot.
report.setScreenshot(screenshot); // Call this method if screenshot was changed somehow.
// You can also add custom attributes to a report.
report.setAttribute("attr1", "attr1 value");
// ...

// Upload formed report.
Bugsee.upload(report);

// Relaunch Bugsee
Bugsee.relaunch(); // to relaunch with default options.
//or
HashMap<String, Object> options = new HashMap<String, Object>();
// Set custom options.
//...
Bugsee.relaunch(options); // to relaunch Bugsee with custom options.

!Kotlin

// Stop recording.
Bugsee.stop()

// Get report to fill.
val report = Bugsee.createReport()

// Fill report in a custom UI.
report.setSummary("UI is broken")
report.setDescription("It happened when I pressed the button.")
val screenshot: Bitmap = report.getScreenshot()
// Annotate screenshot.
report.setScreenshot(screenshot) // Call this method if screenshot was changed somehow.
// You can also add custom attributes to a report.
report.setAttribute("attr1", "attr1 value")
// ...

// Upload formed report.
Bugsee.upload(report)

// Relaunch Bugsee.
Bugsee.relaunch() // to relaunch with default options.
//or
val options : HashMap<String, Any> = hashMapOf()
// Set custom options.
//...
Bugsee.relaunch(options) // to relaunch Bugsee with custom options.

Non-fatal exceptions

It is possible to report non-fatal exceptions from code. These reports will get combined similar to crashes, and you will be provided with statistics and a break down by unique devices, Android versions, etc.

!Java

try {
    // Code, which can throw exception.
} catch(Exception e) {
    Bugsee.logException(e);
}

!Kotlin

try {
    // Code, which can throw exception.
} catch (e: Exception) {
    Bugsee.logException(e)
}

If you have single method to log all exceptions from the entire application, you may end up having all these exceptions grouped together in the Bugsee web dashboard. To avoid this, you should use logException() variant with options argument.

Specify skipFrames parameter in options.Rules to skip the specified number of frames when comparing stack traces during reports grouping. Doing so will allow you to group exceptions from different origins.

!Java

Exception exception = new AndroidRuntimeException("LogException: SkipFrames test case");
ExceptionLoggingOptions options = new ExceptionLoggingOptions();
// skip 1 top frame when comparing stack traces
options.Rules.setSkipFrames(1);
Bugsee.logException(exception, options);

!Kotlin

val exception = AndroidRuntimeException("LogException: SkipFrames test case")
val options = ExceptionLoggingOptions()
// skip 1 top frame when comparing stack traces
options.Rules.skipFrames = 1
Bugsee.logException(exception, options)