> For the complete documentation index, see [llms.txt](https://platform-business.gitbook.io/klat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform-business.gitbook.io/klat/android/getting-started.md). Agents can also search and read this documentation through its [MCP server](https://platform-business.gitbook.io/klat/~gitbook/mcp).

# Getting Started

## 0. 최소 지원 사양

* Android API Level 21
* AndroidX Compatibility
* Compile and Target SDK version 35
* Build Tool Version 35

## 1. Android SDK 추가

1\) 프로젝트 단 `build.gradle` 파일에 `allprojects` 섹션에서 아래의 Repository를 추가합니다.

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

2\) 모듈 단 `build.gradle` 파일에 `dependencies` 섹션에서 아래의 Dependency를 추가합니다.

```
dependencies {
    implementation 'com.github.adxcorp:talkplus-android:1.0.5'
}
```

{% hint style="info" %}
**현재 최신 SDK 버전은 1.0.4 입니다.**
{% endhint %}

<details>

<summary>SDK 변경 이력</summary>

v1.0.4 (2026-05-19)\
: 사용자 조회 API 추가

v1.0.2 (2025-03-06)\
: 서비스 안정화\
\
v1.0.0 (2025-02-13)\
: Klat Android SDK 1.0.0 배포

</details>

## 2. Initialize

1\) Application Class 혹은 MainActivity의 `onCreate`에서 TalkPlus API를 사용하기 전 초기화 함수를 호출해줍니다.

```java
public class SampleApplication extends MultiDexApplication {
    @Override
    public void onCreate() {
        super.onCreate();

        TalkPlus.init(getApplicationContext(), "YOUR_APP_ID");
    }
}

```

## 3. Login / Logout 프로세스

* TalkPlus는 매 실행시마다 login 함수의 호출이 필요합니다.
* login이 이루어진 후 logout이 호출되기 전까지 등록된 FCM Token은 유지됩니다. 따라서 오프라인 상태에 들어간 경우에도 Push Notification을 받을 수 있습니다.
* 사용자가 logout을 할 경우 TalkPlus의 `logout` 함수를 함께 호출해주셔야 합니다. `logout` 함수 호출이 누락될 경우 이전에 로그인된 사용자의 Push Notification을 받게될 수 있습니다.

## 4. Realtime Message

* TalkPlus는 앱의 실행주기에 맞춰 Realtime 채널을 구독/구독해제 하고 있습니다.
* App이 Foreground에 있을 경우에만 WebSocket을 통하여 메시지를 받고 Background일 경우에 대해서는 FCM을 통해 메시지를 받도록 구현되어 있습니다.
* 만약 Background에서도 메시지를 받기를 원한다면 Push Notification 항목을 참고하시어 FCM을 연동하셔야 합니다.
* 이는 Application의 배터리 소모를 최소화 하기 위한 방안입니다.
