# Get Started

## Configure and Initialize TapTalk.io Android SDK

#### **Step 1: Create a new application from your dashboard**

**1.** Login to [TapTalk.io Dashboard](https://taptalk.io/), then choose **Development** -> **Apps**

![](/files/-MHKvQJYwokZj2SvRd6U)

**2**. Click **New App** Button, input **App Name** and choose **Platform**, and then click **Create New App** Button.

![](/files/-MHKxC_cD1-kv3lPxiSk)

![](/files/-MHKxGJV7RBtqLBu8UwT)

**3.** A pop-up dialog will be shown with provided **App Key ID** & **App Key Secret**

![](/files/-MHKxQLyhxLOunGM05hx)

{% hint style="warning" %}
**Note:** Please remember to save your **App Key ID** & your **App Key Secret** because it will only be shown once and will be used in TapTalk.io initialization
{% endhint %}

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

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

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

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

{% 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-android:2.18.3'
}
```

{% endcode %}

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

In the app build.gradle file, make sure that your project is using the supported Java version like below.

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

```javascript
android {
    
    ...

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

{% endcode %}

#### Step 3: Initialize TapTalk.io in your Application class

In order to use TapTalk.io, you must first initialize a TapTalk instance by passing the `APP_ID`, `APP_SECRET`, `APP_ICON`, `APP_BASE_URL`, and `IMPLEMENTATION_TYPE` assigned to your application to the `init` method as a parameter. Generally, initialization is implemented in the **Application** class in your project.

{% hint style="warning" %}
**Note:** To get **BASE\_URL** you can follow our documentation on [how to get Base URL](/powertalk-chat-sdk-documentation/powertalk-server-api/base-url.md) on TapTalk.io
{% endhint %}

{% tabs %}
{% tab title="Java" %}

```java
import io.taptalk.TapTalk.Helper.TapTalk;
import io.taptalk.TapTalk.Listener.TapListener;

...

TapTalk.init(
    CONTEXT, 
    APP_KEY_ID, 
    APP_KEY_SECRET,            
    APP_ICON, 
    APP_NAME, 
    APP_BASE_URL,            
    IMPLEMENTATION_TYPE, 
    tapListener
);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
import io.taptalk.TapTalk.Helper.TapTalk
import io.taptalk.TapTalk.Listener.TapListener

...

TapTalk.init(
  CONTEXT, 
  APP_KEY_ID, 
  APP_KEY_SECRET,            
  APP_ICON, 
  APP_NAME, 
  APP_BASE_URL,            
  IMPLEMENTATION_TYPE, 
  tapListener
)
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Parameters**\
**CONTEXT**: (Context) application context\
**APP\_KEY\_ID**: (String) application key ID\
**APP\_KEY\_SECRET**: (String) application key Secret\
**APP\_ICON**: (int) drawable resource ID\
**APP\_NAME**: (String) your application name\
**APP\_BASE\_URL**: (String) base API URL\
**IMPLEMENTATION\_TYPE**: (enum) found in TapTalkImplentationType, more detailed information below\
**tapListener**: (TapListener) an interface to detect TapTalk Android SDK's delegates and callbacks
{% endhint %}

{% hint style="info" %}
**IMPLEMENTATION\_TYPE**\
TapTalkImplementationType consists of 3 types which are:\
\&#xNAN;**`TapTalkImplementationTypeUI`**: used for implementation with only TapUI\
\&#xNAN;**`TapTalkImplementationTypeCore`**: used for implementation with only TapCore\
\&#xNAN;**`TapTalkImplementationTypeCombine`**: used for implementation with both of TapCore and TapUI combined
{% endhint %}

{% hint style="info" %}
**Note**: In the [Event Listener](/powertalk-chat-sdk-documentation/powertalk-android/event-listener.md) page, you can find detailed information on the usages of TapTalk Android SDK's delegates and callbacks.
{% endhint %}

#### Step 4: 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.

#### Step 5: Authenticate to TapTalk.io

In order to use the abilities of the Android SDK in your client app, a TapTalk instance must be initiated in each client app through user authentication with TapTalk.io server. An authenticated user account allows the instance to communicate and interact with the server. To authenticate your user with the server, follow the instructions in [Authentication page](/powertalk-chat-sdk-documentation/powertalk-android/authentication.md).

### Open Your First Room List

To open room list view, you can simply use the `openRoomList()` method in the **TapUI** class. Creating a user interface won't be necessary, because TapTalk.io have provided an integrated user interface to be used in your application. To use TapTalk.io's chat interface, simply initialize our **TapUI** method and you are good to go. For more information about TapUI and TapCore, please see [TapUI and TapCore page](/powertalk-chat-sdk-documentation/powertalk-android/tapui-and-tapcore.md). In this example, we will open the room list view directly in your application's **MainActivity** `onCreate()` method.

{% tabs %}
{% tab title="Java" %}

```java
import io.taptalk.TapTalk.Helper.TapTalk;
import io.taptalk.TapTalk.Manager.TapUI;

...

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
      
    if (TapTalk.isAuthenticated()) {
        // Show room list if authentication is completed
        TapUI.getInstance().openRoomList(this);
    }
    else {
        // Authentication is required
    }
    finish();
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
import io.taptalk.TapTalk.Helper.TapTalk
import io.taptalk.TapTalk.Manager.TapUI

...

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
      
    if (TapTalk.isAuthenticated()) {
        // Show room list if authentication is completed
        TapUI.getInstance().openRoomList(this)
    }
    else {
        // Authentication is required
    }
    finish()
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Note**: For more information about Room List View for TapUI, please see [Room List section.](/powertalk-chat-sdk-documentation/powertalk-android/room-list.md)
{% 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/powertalk-chat-sdk-documentation/powertalk-android/get-started.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.
