Android SDK ⁠-⁠ Initializing the SDK

The following line will install the tracker and with it the SDK for you to take advantage of all tracker features.

Add it in your root build.gradle at the end of repositories:

dependencyResolutionManagement {
    repositories {
      maven { url '' }

Add the dependency in your app build.gradle file:

dependencies {

When instantiating OpenReplay’s tracker, there are several configuration options you can provide to customize many aspects of the recording and the recording experience. You must set the projectKey option in the constructor. You can get this value from your OpenReplay dashboard under ‘Preferences > Projects’.

Add the following code to your MainActivity.kt file:

// MainActivity.kt
import com.openreplay.tracker.OpenReplay


class MainActivity : TrackingActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    // not required if you're using our SaaS version
    OpenReplay.serverURL = ""
    // check out our SDK docs to see available options
      onStarted = {
        println("OpenReplay Started")

    // ...
// MainActivity.kt
import com.openreplay.tracker.listeners.TrackingActivity

// ...
class MainActivity : TrackingActivity() {
  // ...

See how to sanitize data in Android replays for more details.

  • crashes: Bool Enables crashlytics.
  • analytics: Bool Enables analytics tracking of marked views.
  • performances: Bool Enables performance listener.
  • logs: Bool Enables logs listener.
  • screen: Bool Enables screen recorder.
  • wifiOnly: Bool Forces tracker to start only if user has a wifi connection.

If you have any questions about this process, feel free to reach out to us on our Slack or check out our Forum.