This guide walks you through the minimum steps needed to go from a blank Android project to a working channel list screen backed by the Sceyt Chat API. By the end you will have the UIKit initialized, a user connected, andDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sceyt/sceyt-chat-android-uikit/llms.txt
Use this file to discover all available pages before exploring further.
ChannelListFragment displayed inside an Activity — all in under 10 minutes.
Add the dependency
Follow the Installation guide to add Maven Central and JitPack to your repository block, then declare the UIKit artifact in your app module:
build.gradle.kts
Initialize in your Application class
Create a custom
Application subclass (or open the one you already have) and call SceytChatUIKit.initialize(…) inside onCreate. The method accepts four parameters:| Parameter | Description |
|---|---|
appContext | The Android Application context |
apiUrl | Your Sceyt application API URL (e.g. "https://us-ohio-api.sceyt.com") |
appId | Your Sceyt application ID |
clientId | A unique identifier for this device / session |
enableDatabase | Whether to enable the local Room database for offline caching |
MyApplication.kt
If you are using Koin for dependency injection, call
startKoin { … } before SceytChatUIKit.initialize(…). Initializing Sceyt first causes the UIKit’s internal Koin modules to attach to the wrong application context and can produce runtime errors.Declare your Application class in AndroidManifest.xml
Register the custom
Application subclass so Android instantiates it at process start, ensuring the UIKit is ready before any Activity or Service runs.AndroidManifest.xml
Connect a user
After initialization, establish a connection to the Sceyt Chat API by passing an authentication token. Call this after you have obtained a valid token from your own backend:
SceytChatUIKit.connect is non-blocking and returns immediately. Connection state changes are emitted through ConnectionEventManager.onChangedConnectStatusFlow and can be observed as a Kotlin Flow anywhere in your app.Embed ChannelListFragment in an Activity
ChannelListFragment is a self-contained Fragment that renders the full channel list with a search bar, a floating action button for starting new chats, and a live connection-status indicator. Add it to your layout and commit it via the Fragment manager:activity_main.xml
MainActivity.kt
ChannelListFragment is an open class — subclass it to override openStartChatActivity(), openGlobalSearch(), or setupConnectionStatus() without touching the rest of the UI.Handle token expiry
Sceyt tokens expire. The UIKit exposes two Kotlin Flows on
Collect these flows in a long-lived scope (e.g., inside your
SceytChatUIKit.chatUIFacade to let you refresh seamlessly:| Flow | When it emits |
|---|---|
onTokenExpired | The current token has already expired; reconnect immediately with a new token |
onTokenWillExpire | The token is about to expire; proactively refresh it via updateToken(…) |
Application or a background service):MyApplication.kt