This guide will help you get started with Ably Chat in a new Android Kotlin application built with Jetpack Compose. You’ll learn how to create chat rooms, send messages, and implement realtime features like typing indicators and presence.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ably/docs/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Sign up for an Ably account.
- Create a new app, and get your first API key.
- Create a new Android project with Jetpack Compose. For detailed instructions, refer to the Android Studio documentation.
-
Add the Ably dependencies to your app-level
build.gradle.ktsfile:
Step 1: Set Up Ably
In production, you should use token authentication to avoid exposing your API keys publicly. Replace the contents of yourMainActivity.kt file:
Step 2: Create a Room and Send Messages
Add composable functions to create a room and send messages:Next Steps
- Understand token authentication before going to production
- Read more about using rooms and sending messages
- Find out more regarding presence
