Activity history

Shake diligently tracks user's interaction with your app, their network traffic, notifications, logs and system events, and automatically attaches all of those to every bug report.

Introduction

You can inspect all events that lead to a bug being reported. A link to Activity history is located in the top right corner:

Activity screen

Setting up

User actions

To set up the SDK to observe taps made on your app's UI elements, add this to any Activity you want to track:

MainActivity.kt
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
Shake.handleTouchEvent(event, this)
return super.dispatchTouchEvent(event)
}

Network requests

If you want to see user's network traffic to fix bugs more efficiently, add this line of code to your OkHttpClient:

App.kt
val okHttpClient = OkHttpClient()
.newBuilder()
.addInterceptor(ShakeNetworkInterceptor())
.build()

If you don’t use OkHttpClient, use this method to forward requests to Shake:

App.kt
Shake.handleNetworkRequest(
connection: HttpURLConnection,
requestBody: String,
responseBody: String)

You can add your own custom network requests at any time:

App.kt
val networkRequestBuilder = NetworkRequestBuilder()
.setUrl("https://api.github.com")
.setMethod("POST")
.setRequestHeaders(requestHeaders)
.setRequestBody(requestBody)
.setTimestamp(Date())
Shake.insertNetworkRequest(networkRequestBuilder)

System events

System events are tracked automatically and require no additional setup. These are application lifecycle events.

Notifications

In order for Shake to track user notifications throughout your app, add this line of code where appropriate:

App.kt
startActivity(Intent("android.settings." +
"ACTION_NOTIFICATION_LISTENER_SETTINGS"))
note

This starts the notification listener service, which will require users to grant Notification access the first time they open your app.

If you want Shake to manually handle notification tracking, you can use this method instead:

App.kt
Shake.handleNotification(
notificationTitle: String,
notificationDescription: String
)

Custom logs

You can add your own custom logs to Activity history, which will then be shown as part of every bug report. Here’s an example of how this would look like in code:

App.kt
Shake.log(LogLevel.INFO, "Log message goes here!")

Here are all possible log levels you can use:

App.kt
LogLevel.VERBOSE
LogLevel.DEBUG
LogLevel.INFO
LogLevel.WARN
LogLevel.ERROR

Console logs

Console logs are recorded automatically and require no additional setup. If you want to disable this feature use the method below:

App.kt
Shake.getReportConfiguration().isConsoleLogsEnabled = false
note

Make sure that Activity history is enabled if you want to send console logs with your report.

Limitations

In a Free workspace you can see up to 20 events that lead to every bug. If you need to dive really deep to find causes of the weirdest bugs, in a Premium workspace you can browse the entire Activity history.

Network request limit for both request body and response body is 100 kB respectively. If request body or response body contains binary data, it will be presented as a Binary data string.

Enabling and disabling

Activity history is enabled by default, however, you can use the method below to disable it:

App.kt
Shake.getReportConfiguration().isEnableActivityHistory = false