Giter Club home page Giter Club logo

bluetooth-chat-mvvm's Introduction

Bluetooth Chat

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.

Screenshots

home_screen chatting_screen

Features

  • Scan nearby bluetooth devices.
  • Pair with nearby devices.
  • Once paired, start chat with the paired device.

How to use

  1. Give the appropriate permission asked at startup.
  2. Open BluetoothChat app on both the devices and turn on bluetooth.
  3. Click on start server button in one of the device.
  4. 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.
  5. After completing the chat, click on the cross button at the top-right corner that will close the chat on both the devices.

Build With

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.

Architecture

  1. Client-Server architecture to transfer chats from one device to another
  2. MVVM (Model-View-ViewModel) architecture.
  3. UDF (Unidirectional Data Flow) Pattern.

Classes And Roles

  • 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.