This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the XMTP Android SDK repository - a native Android SDK written in Kotlin that provides XMTP messaging functionality for Android applications. The project implements the XMTP protocol natively on Android and includes a comprehensive example application demonstrating the SDK's capabilities.
./gradlew build- Build the entire project./gradlew :library:build- Build only the library module./gradlew :example:build- Build only the example app./gradlew clean- Clean build artifacts./gradlew assembleDebug- Build debug variant./gradlew assembleRelease- Build release variant
./gradlew ktlintCheck- Run ktlint code style checks./gradlew ktlintFormat- Auto-format code with ktlint./gradlew lint- Run Android lint checks./gradlew test- Run unit tests./gradlew connectedAndroidTest- Run instrumented tests (requires device/emulator)
./gradlew dokkaGfmPartial- Generate documentation./gradlew dokkaHtml- Generate HTML documentation
./gradlew publishToMavenLocal- Publish to local Maven repository./gradlew publishToSonatype- Publish to Sonatype (requires credentials)
- library/: Main SDK source code
- src/main/java/org/xmtp/android/library/: Core SDK implementation
- Client.kt: Main XMTP client for managing connections
- Conversation.kt: Conversation management
- Group.kt: Group messaging functionality
- Dm.kt: Direct messaging functionality
- codecs/: Content type codecs (Text, Reply, ReadReceipt, GroupUpdated)
- push/: Push notification support
- src/main/java/org/xmtp/android/library/: Core SDK implementation
- example/: Example Android application demonstrating SDK usage
- src/main/java/org/xmtp/android/example/: Example app implementation
- library/src/androidTest/: Instrumented tests
- library/src/test/: Unit tests
- Client: Main XMTP client for authentication and conversation management
- Conversation: Base class for all conversation types
- Group: Group messaging with MLS (Messaging Layer Security)
- Dm: Direct messaging functionality
- CodecRegistry: Registry for content type codecs
- XMTPPush: Push notification management
The SDK uses libxmtp native library through JNI bindings for core XMTP protocol implementation. The project uses Protocol Buffers for message serialization and includes support for various content types through a codec system.
- Android: Minimum SDK 23, Target SDK 35
- Kotlin: Version 2.0.0
- Java: Version 17
- Android Gradle Plugin: Version 8.4.0
The project includes comprehensive test coverage:
- Unit tests in
library/src/test/ - Instrumented tests in
library/src/androidTest/ - Example app tests in
example/src/androidTest/
Tests cover:
- Client functionality and authentication
- Group operations and MLS
- DM operations
- Content types and codecs
- Cryptographic operations
- Push notifications
- Uses Maven Central for distribution
- Requires signing for release builds
- Publishes to Sonatype OSSRH
- Documentation published to GitHub Pages
- Pull requests are automatically reviewed by Claude AI via GitHub Actions
- Reviews focus on code quality, security, performance, and adherence to Kotlin/Android best practices
- Requires
CLAUDE_CODE_OAUTH_TOKENsecret to be configured in repository settings
build.gradle: Root build configurationlibrary/build.gradle: Library module configuration with publishing setupexample/build.gradle: Example app configurationsettings.gradle: Project structure configurationlibrary/src/main/AndroidManifest.xml: Library manifest- Native libxmtp binaries are included for ARM64 and x86_64 architectures
The SDK supports XMTP V3 only (V2 deprecated as of May 2025) with full MLS support for secure group messaging. The project uses ktlint for code formatting and includes comprehensive documentation generated with Dokka.