A simple chatting android app that uses bluetooth to connect with other devices and transfer chats. It is made in Jetpack Compose and follows MVVM Architecture for the flow of data.
- Scan nearby bluetooth devices.
- Pair with nearby devices.
- Once paired, start chat with the paired device.
- Give the appropriate permission asked at startup.
- Open BluetoothChat app on both the devices and turn on bluetooth.
- Click on start server button in one of the device.
- On the other device, click on start scan.
- If the device is paired it will be shown in the paired devices and clicking it will open the chat.
- If not, wait for the scan and when the device appears below the scanned devices click and pair it. Upon pairing, you will be navigated to chatting screen.
- After completing the chat, click on the cross button at the top-right corner that will close the chat on both the devices.
Jetpack Compose : To build UI.
Android Bluetooth API : To
connect devices and share data.
Kotlin Coroutines and Flow : For asynchronous
programming.
Hilt : For dependency
injection.
- Client-Server architecture to transfer chats from one device to another
- MVVM (Model-View-ViewModel) architecture.
- UDF (Unidirectional Data Flow) Pattern.
- AndroidBTController
- Get Paired devices
- To start and stop scans for new bluetooth devices
- To connect and disconnect bluetooth devices
- BTDataTransferService
- To send messages
- Listen for incoming messages