A modern Android chat application that enables direct communication between devices using Bluetooth technology, without requiring an internet connection.
- Device Discovery: Find nearby Bluetooth devices
- Real-time Messaging: Send and receive messages in real-time
- Persistent Chats: Message history is stored locally for each device
- Profile Management: View and manage device profiles
- Modern UI: Built with Material 3 design principles
- Kotlin
- Jetpack Compose
- Navigation Compose
- Room Database
- Dagger Hilt
- Bluetooth API
- Android SDK 30 or higher (Android 12+)
- Bluetooth-enabled device
- Android Studio Giraffe or newer
- Clone the repository:
git clone https://github.com/knivram/BluetoothChat.git-
Open the project in Android Studio
-
Build the project:
./gradlew build- Run the app on your device or emulator:
./gradlew installDebug- Run linter after some changes:
./gradlew ktlintCheckThe app follows a clean architecture approach with the following main components:
-
data: Contains implementations of repositories and data sources
- bluetooth: Bluetooth controller implementation
- local: Room database and DAO implementations
-
di: Dependency injection modules
-
domain: Business logic and models
- chat: Contains data models and interfaces for chat functionality
-
presentation: UI components
- components: Reusable UI components
- screens: Main app screens (Chats Overview, Chat, Profile)
- viewmodels: ViewModels for each screen
-
ui: Theme and styling
- Launch the app
- Allow requested Bluetooth and notification permissions
- From the Chats screen, tap the add button to discover nearby devices
- Select a device to start a chat
- Send messages using the text field at the bottom of the screen
Paring new phones can make some problems. An easy fix for that is to just use the settings app to start the pairing process. After that both devices will have eachother in the paired devices list and can direcly start chatting.
The app requires the following permissions:
BLUETOOTH_SCAN: To search for nearby Bluetooth devicesBLUETOOTH_CONNECT: To connect to Bluetooth devicesPOST_NOTIFICATIONS: For chat notifications (Android 13+)