# Get Started

{% hint style="warning" %}
**Before you get started:** Make sure you have [**created a channel in OneTalk dashboard**](/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat.md#setup-live-chat-for-android) and obtain the **`APP_KEY_SECRET.`**
{% endhint %}

### Configure and Initialize TapTalk.io Omnichannel Android SDK

#### Step 1: Install TapTalk.io SDK

To start, open your Android project and add the following repositories to your **top-level** build.gradle file.

{% code title="build.gradle (project)" %}

```javascript
allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
        maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
    }
}
```

{% endcode %}

Then add the following dependency to your **app-level** build.gradle:

{% code title="build.gradle (:app)" %}

```javascript
dependencies {
    implementation 'com.github.taptalk-io:taptalk.io-omnichannel-android:2.6.2'
}
```

{% endcode %}

{% hint style="info" %}
You can check a more updated version release notes of the SDK [here](https://github.com/taptalk-io/taptalk.io-omnichannel-android/releases).
{% endhint %}

{% hint style="warning" %}
**Note**: In the app **build.gradle** file, make sure that your project is using supported Java 8 language features under the `android` tag like below
{% endhint %}

{% code title="build.gradle (:app)" %}

```javascript
android {
    
    ...

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
}
```

{% endcode %}

#### Step 2: Initialize TapTalkLive

&#x20;In order to use TapTalkLive SDK, you must first initialize a TapTalkLive instance by passing the **`CONTEXT`**, **`APP_KEY_SECRET`**, **`CLIENT_APP_ICON`**, and **`CLIENT_APP_NAME`** assigned to your application to the **`init`** method as a parameter. Generally, initialization is implemented in the **Application** class in your project.

{% tabs %}
{% tab title="Java" %}
{% code title="Application.java" %}

```java
import io.taptalk.taptalklive.TapTalkLive;
import io.taptalk.taptalklive.Listener.TapTalkLiveListener;
import io.taptalk.taptalklive.API.Model.ResponseModel.TTLErrorModel;

...

TapTalkLive.init(
    CONTEXT, 
    APP_KEY_SECRET, 
    CLIENT_APP_ICON, 
    CLIENT_APP_NAME,
    new TapTalkLiveListener() {
        @Override
        public void onInitializationCompleted() {
            // Handle initialization success here
        }
        
        @Override
        public void onInitializationFailed(TTLErrorModel error) {
            // Handle initialization failure here
        }
    }
);
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code title="Application.kt" %}

```kotlin
import io.taptalk.taptalklive.TapTalkLive
import io.taptalk.taptalklive.Listener.TapTalkLiveListener
import io.taptalk.taptalklive.API.Model.ResponseModel.TTLErrorModel

...

TapTalkLive.init(
    CONTEXT, 
    APP_KEY_SECRET, 
    CLIENT_APP_ICON, 
    CLIENT_APP_NAME,
    object : TapTalkLiveListener() {
        override fun onInitializationCompleted() {
            // Handle initialization success here
        }

        override fun onInitializationFailed(error: TTLErrorModel?) {
            // Handle initialization failure here
        }
    }
)
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}

#### Parameters

**`CONTEXT`** (Context) application context\
\&#xNAN;**`APP_KEY_SECRET`**: (String) application key Secret\
\&#xNAN;**`CLIENT_APP_ICON`**: (int) drawable resource ID of your application's icon\
\&#xNAN;**`CLIENT_APP_NAME`**: (String) your application name\
\&#xNAN;**`tapTalkLiveListener`**: (TapTalkLiveListener) an interface to detect TapTalkLive Android SDK's delegates and callbacks
{% endhint %}

{% hint style="info" %}
Note: A more complete implementation of TapTalkLiveListener callbacks can be seen in the [Event Listeners page](/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat/onetalk-android/event-listener.md).
{% endhint %}

#### Step 3: Enable Chat Features

Please follow the steps in [Enable Chat Features](/powertalk-chat-sdk-documentation/powertalk-android/enable-chat-features.md) page to enable TapTalk.io's chat features, such as contact sync and sending media, document, and location messages.

### Open TapTalk Omnichannel View

To open TapTalkLive's view UI for your application, you can use the **`openTapTalkLiveView`** method from the **TapTalkLive** class. This will open a homepage activity containing a list of available channels, the user's latest case, and QnA path.

{% tabs %}
{% tab title="Java" %}
{% code title="YourActivity.java" %}

```java
import io.taptalk.taptalklive.TapTalkLive;

TapTalkLive.openTapTalkLiveView(YourActivity.this);
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code title="YourActivity.kt" %}

```kotlin
import io.taptalk.taptalklive.TapTalkLive

TapTalkLive.openTapTalkLiveView(this@YourActivity)
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**`openTapTalkLiveView`** will return **`true`** if opening the view is successful, and will return `false` if it fails due to incomplete initialization. TapTalkLive initialization might not be completed if the device is not connected to internet or an incorrect **`APP_KEY_SECRET`** parameter was provided.
{% endhint %}


---

# 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.taptalk.io/onetalk-omnichannel-documentation/onetalk-channel-integration/live-chat/onetalk-android/get-started-android.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.
