> ## Documentation Index
> Fetch the complete documentation index at: https://docs.userpilot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics Kotlin Userpilot

> Userpilot Android SDK enables you to capture user insights and deliver personalized in-app experiences in real time.

Userpilot Android SDK enables you to capture user insights and deliver personalized in-app experiences in real time. With just a one-time setup, you can immediately begin leveraging Userpilot’s analytics and engagement features to understand user behaviors and guide their journeys in-app.

This document provides a step-by-step walkthrough of the installation Userpilot device mode support to your applications via this plugin for [Analytics-Kotlin](https://github.com/segmentio/analytics-kotlin)

## Installation

The library is distributed through Maven Central. Add the Userpilot module to your build.gradle as a dependency as shown in the code sample below, and replace the `<latest_version>` with the [latest release version](https://central.sonatype.com/artifact/com.userpilot/segment-userpilot).\
Check [Userpilot Android SDK](../installation/mobile/android/installation) for more details.

```kotlin theme={null}
repositories {
    mavenCentral()
}

dependencies {
    implementation 'com.userpilot:segment-userpilot:<latest_version>'
}
```

## Initialization

Just under your Analytics-Kotlin library setup, call `analytics.add(plugin = ...)` to add an instance of the plugin to the Analytics timeline.

```kotlin theme={null}
 analytics = Analytics("<YOUR_WRITE_KEY>", applicationContext) {
        this.flushAt = 3
        this.trackApplicationLifecycleEvents = true
    }
    analytics.add(plugin = UserpilotDestination(applicationContext))
```

Your events will now begin to flow to Userpilot in device mode.

## Userpilot SDK callbacks

To gain full control and take advantage of all Userpilot SDK features, you can use the `UserpilotConfig` lambda to configure the SDK according to your app's needs.

For example, if you'd like to handle Userpilot deep links, you can implement the `UserpilotNavigationHandler` interface to manage navigation events triggered by the SDK.

```kotlin theme={null}
userpilotDestination = UserpilotDestination(applicationContext) {
            // optionally apply customizations using the UserpilotConfig here
            loggingEnabled = true
            navigationHandler = object : UserpilotNavigationHandler {
                override fun navigateTo(uri: Uri) {
                
                }
            }
        }
analytics.add(plugin = userpilotDestination)
```

## **Configurations (Optional)**

| **Parameter**                              | **Type**      | **Description**                                                                                                                                                                |
| ------------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| loggingEnabled                             | Boolean       | Enable or Disable logs for SDK<br /><br />\*\*Default: false \*\*                                                                                                              |
| packageNames                               | List\<String> | Optional property that allows for setting custom package list for fonts, mostly used when your fonts are stored in a different package than your main app (multi-module apps). |
| disableRequestPushNotificationsPermissions | Boolean       | Disable request push notifications permission by SDK.<br /><br />\*\*Default: false \*\*                                                                                       |
| useInAppBrowser                            | Boolean       | A configuration to indicate when to open the URL inside CustomTabsIntent or not.<br /><br />\*\*Default: false \*\*                                                            |

<Frame>
  [**For any questions or concerns please reach out to support@userpilot.com**](mailto:support@userpilot.com)
</Frame>
