# Getting Started with Android SDK

## About

The Firework Android SDK is a library offering various programming interfaces for developers to embed video feeds from Firework, a platform specializing in shoppable videos and livestreams, into an Android application.

## Requirements

Live2.ai is compatible with the following:

* Android min SDK 21
* Kotlin/Java code base
* Gradle build system

## Retrieve your Auth Token

To integrate the Live2.ai Android SDK into your application, you need to register your application with   the Live2.ai platform and obtain a unique auth token ID. To get the auth token ID, you should:

1. Register your application with the Live2.ai platform.
2. Obtain your unique auth token.

## Integrating Live2.ai Android SDK

To access the latest stable version of a library package from MavenCentral, ensure that your project is configured to use the MavenCentral repository in your `build.gradle` or `build.gradle.kts` file.&#x20;

```gradle
Gradle:

repositories {
    ...
    mavenCentral()
}
```

Include these dependencies according to your needs:

* **Live2.ai SDK:** This is the core dependency for initializing the Live2.ai Android SDK and supporting video and livestream functionalities.

## SDK Initialization

Call this code in your custom application class  or in MainActivity `onCreate` method to initialize the Live2.ai SDK:

```kotlin
Kotlin:

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        val live2 = Live2SDK.installer(application, this)
            .userId(USER_ID) // Optional field to set the User ID in your eco-system.
            .authToken(TOKEN) // Client OAUTH Id
            .muteOnLaunch(false)
            .enableCaching(true)
            .maxCacheSizeBytes(MAX_CACHE_SIZE_IN_BYTES) // Max cache size used by video players, 25MB by default
            .enableForwardBackwardGestures(true)
            .enablePiP(true)
            .build()
    }
}

```

## BOM (Bill of Material)

Since Live2.ai is developing multiple SDKs for various purposes, which might result in dependency conflicts, we have introduced a BoM (Bill of Materials) solution. This approach is useful when your app relies on multiple Live2.ai SDKs or open-source libraries from Live2.ai.

With this solution, your project's Gradle file should only specify the platform dependency with the latest BoM version.

```gradle
Gradle:

val live2BomVersion = "latest_live2_bom_version" // eg. 1.0.1
implementation(platform("com.live2:live2-bom:$live2BomVersion"))

// no version is needed
implementation("com.live2:core")
implementation("com.live2:ui")
implementation("com.live2:player")
```

## Setup your project

We recommend setting `android:largeHeap="true"` in the `application` tag within your `AndroidManifest.xml` file.

```
<application
        ......
        android:largeHeap="true">

    ......

</application>
```

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.live2.ai/live2.ai-integration/android-sdk/getting-started-with-android-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
