---
title: "Android: Get Started"
description: "Follow the step-by-step guide to add, install, configure, and initialize the Lytics SDK in your Android app."
url: "https://www.contentstack.com/docs/developers/sdks/lytics/android/get-started"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-11-15"
---

# Android: Get Started

## Installation

### Before You Begin

Before you begin implementing the Lytics SDK for Android, please make sure you have the following:

*   Access to a Lytics account capable of collecting streaming data.
*   The latest version of Android Studio (v2021.3.1 or higher)
*   An Android app that you can use to implement the Lytics SDK for Android  
    The binary distribution files of the SDK have been built for Android 8+.

### Step 1. Add the Lytics SDK & Dependencies:

#### Add the JitPack repository to your build file

Add to your root build.gradle file:

```
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
```

Or for newer Android projects, repositories are defined in the project's settings.gradle file:

```
dependencyResolutionManagement {  
    repositories {  
        ...  
        maven { url '<https://jitpack.io>' }  
    }  
}
```

View the latest release on JitPack: [Release](https://jitpack.io/#com.github.lytics/android-sdk)

#### Add the Lytics Android SDK library as a gradle dependency.

```
dependencies {
    implementation 'com.github.lytics:android-sdk:<VERSION>'
}
```

#### Add permissions to your AndroidManifest.xml

Add the following permissions to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.INTERNET" />

This permission is required to send events to the Lytics API.

<uses-permission android:name="android.permission.ACCESS\_NETWORK\_STATE" />

This permission is technically optional but highly recommended to allow the library to determine the best time to send events to the API.

### Step 2. Configure the SDK

A variety of top-level [configuration](/docs/developers/sdks/lytics/android/technical-documentation#configuration) options are available to ensure the SDK can be tailored to the needs of your particular application. To get started, however, we need only add your valid Lytics API token to the Lytics.shared.start initialization call as outlined below:

```
Lytics.init(applicationContext, LyticsConfiguration(
    apiKey = "YOUR-VALID-LYTICS-API-TOKEN",
))
```

```
import android.app.Application
import com.lytics.android.Lytics
import com.lytics.android.LyticsConfiguration
import com.lytics.android.logging.LogLevel

class DemoApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        val config = LyticsConfiguration(
            apiKey = "YOUR-VALID-LYTICS-API-TOKEN",
        )
        
        Lytics.init(applicationContext, config)
    }
}
```

### Step 3. Identifying a User

Once we have initialized the SDK, it is a best practice to [identify](/docs/developers/sdks/lytics/android/technical-documentation#identifying-users) the user anywhere formally they provide additional strong identifiers, such as a username or email, upon login, for example. This ensures your profiles have the highest potential for properly unifying across your various data sources.

Do note, this step is optional. By default, the Lytics SDK will create an anonymous identifier for all users and leverage that to merge with disparate sources as we do with our traditional web-based JavaScript SDK.

```
Lytics.identify(
  LyticsIdentityEvent(
    identifiers = mapOf(
      "email" to "kevin@homealone.com"
    )
  )
)
```

### Step 4. Tracking Activity

Once the user has been identified (optional), we can begin [tracking](/docs/developers/sdks/lytics/android/technical-documentation#tracking-events) various activities throughout their visit. Typical activities include screen views, clicks, purchases, etc. A full scope of event tracking flexibility can be found in the technical documentation section below.

```
Lytics.track(
  LyticsEvent(
    name = "purchase",
    properties: mapOf(
      "total" : 19.99,
      "item" : "Slingshot"
    )
  )
)
```