Skip to main content
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.

Prerequisites

  1. Sign up for an Ably account.
  2. Create a new app, and get your first API key.
  3. Create a new Android project with Jetpack Compose. For detailed instructions, refer to the Android Studio documentation.
  4. Add the Ably dependencies to your app-level build.gradle.kts file:

Step 1: Set Up Ably

In production, you should use token authentication to avoid exposing your API keys publicly. Replace the contents of your MainActivity.kt file:

Step 2: Create a Room and Send Messages

Add composable functions to create a room and send messages:

Next Steps

Explore the Ably CLI further, or check out the Chat Kotlin API references for additional functionality.

Build docs developers (and LLMs) love