# halilozel1903/androidbluetoothchatapp architecture

> Architecture diagram of the GitHub repository halilozel1903/androidbluetoothchatapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/halilozel1903/androidbluetoothchatapp
- Repository: https://github.com/halilozel1903/androidbluetoothchatapp

## Overview

This is a small Android Bluetooth chat app. The user views paired devices, starts listening or selects a peer to connect, then sends and receives text over a Bluetooth socket; connection and message status are reflected in the UI. The sampled source places the UI, connection threads, stream handling, and message dispatch in MainActivity.java, so these are separate responsibilities sharing that path. README capabilities inform the overview, but unsampled scan and multi-connection behavior are not mapped as implemented flows.

Main entry points: [`app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`](https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java) (Chat activity), [`app/src/main/res/layout/activity_main.xml`](https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/res/layout/activity_main.xml) (Chat screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Chat UI"]
  node_activity["Chat activity<br/>[MainActivity.java]"]
  node_layout["Chat screen<br/>[activity_main.xml]"]
end

subgraph group_connection["Bluetooth Connection"]
  node_android_bt["Android Bluetooth API"]
  node_connect_workers["Connection workers<br/>[MainActivity.java]"]
end

subgraph group_messaging["Message Handling"]
  node_socket_io["Socket streams<br/>[MainActivity.java]"]
  node_handler["UI message handler<br/>[MainActivity.java]"]
end

node_user(("User"))

node_user -->|"uses"| node_activity
node_activity -->|"loads"| node_layout
node_activity -->|"accesses"| node_android_bt
node_activity -->|"starts"| node_connect_workers
node_connect_workers -->|"accepts or connects"| node_android_bt
node_connect_workers -->|"starts"| node_socket_io
node_activity -->|"writes text"| node_socket_io
node_socket_io -->|"dispatches received data"| node_handler
node_handler -->|"updates UI"| node_activity

click node_activity "https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java"
click node_layout "https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/res/layout/activity_main.xml"
click node_connect_workers "https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java"
click node_socket_io "https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java"
click node_handler "https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_activity,node_layout,node_user toneBlue
class node_android_bt,node_connect_workers toneAmber
class node_socket_io,node_handler toneMint
```

## Components

### Chat UI

- [Chat activity](https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java): `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`
- [Chat screen](https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/res/layout/activity_main.xml): `app/src/main/res/layout/activity_main.xml`

### Bluetooth Connection

- **Android Bluetooth API**
- [Connection workers](https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java): `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`

### Message Handling

- [Socket streams](https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java): `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`
- [UI message handler](https://github.com/halilozel1903/androidbluetoothchatapp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java): `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`

### Other components

- **User**

## Connections

- User → Chat activity: uses (evidence: `README.md`)
- Chat activity → Chat screen: loads (evidence: `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`)
- Chat activity → Android Bluetooth API: accesses (evidence: `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`)
- Chat activity → Connection workers: starts (evidence: `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`)
- Connection workers → Android Bluetooth API: accepts or connects (evidence: `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`)
- Connection workers → Socket streams: starts (evidence: `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`)
- Chat activity → Socket streams: writes text (evidence: `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`)
- Socket streams → UI message handler: dispatches received data (evidence: `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`)
- UI message handler → Chat activity: updates UI (evidence: `app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java`)
