Android (Kotlin)

To configure Segment's Android SDK with a custom API host:

import com.segment.analytics.kotlin.android.Analytics
import com.segment.analytics.kotlin.core.*

// Create an analytics client with the given application context and Segment write key.
// NOTE: in android, application context is required to pass as the second parameter.
Analytics("<EVEFAN_SOURCE_WRITE_KEY>", applicationContext) {
  // Automatically track Lifecycle events
  trackApplicationLifecycleEvents = true
  apiHost = "<EVEFAN_WORKER_HOST>/v1"
}

Here's their official guide.

Last updated