# prol3/volumotion architecture

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

- Interactive diagram: https://gitdiagram.com/prol3/volumotion
- Repository: https://github.com/prol3/volumotion

## Overview

VoluMotion is an Android app for touch-free system-volume control using hand rotations, with optional driving-aware background monitoring. The main workflow starts when the user enables the app in the UI: a foreground service analyzes camera frames, hand landmarks are interpreted as rotation, and the resulting direction changes system volume. The service also manages pause/resume and notification behavior; GPS speed monitoring supports automatic driving-mode activation. The README documents these relationships, but the Kotlin files were not sampled, so the graph reflects documented architecture rather than verified call sites.

Main entry points: [`app/src/main/java/com/example/handgesturevolume/service/HandGestureService.kt`](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/service/HandGestureService.kt) (Foreground service), [`app/src/main/java/com/example/handgesturevolume/ui/MainActivity.kt`](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/ui/MainActivity.kt) (Main activity), [`app/src/main/java/com/example/handgesturevolume/utils/DrivingModeDetector.kt`](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/utils/DrivingModeDetector.kt) (Driving detector), [`app/src/main/java/com/example/handgesturevolume/core/HandDetector.kt`](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/core/HandDetector.kt) (Hand landmark detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App controls"]
  node_activity["Main activity<br/>[MainActivity.kt]"]
  node_permissions["Permission manager"]
  node_service["Foreground service"]
end

subgraph group_vision["Gesture recognition"]
  node_camera["CameraX analysis"]
  node_hand["Hand landmark detection<br/>[HandDetector.kt]"]
  node_mediapipe["MediaPipe"]
  node_rotation["Rotation analysis"]
end

subgraph group_driving["Driving mode"]
  node_driving["Driving detector"]
  node_gps["GPS location"]
end

subgraph group_platform["Android integrations"]
  node_volume["Volume controller"]
  node_audio["Android audio"]
  node_notification["Persistent notification"]
end

node_user(("User"))

node_user -->|"operates"| node_activity
node_activity -->|"manages permissions"| node_permissions
node_activity -->|"starts and controls"| node_service
node_service -->|"analyzes frames"| node_camera
node_service -->|"processes frames"| node_hand
node_hand -->|"tracks landmarks"| node_mediapipe
node_service -->|"evaluates motion"| node_rotation
node_service -->|"changes volume"| node_volume
node_volume -->|"controls audio"| node_audio
node_service -->|"monitors driving"| node_driving
node_driving -->|"reads location"| node_gps
node_service -->|"updates notification"| node_notification
node_notification -->|"pauses or resumes"| node_service
node_driving -->|"triggers monitoring"| node_service

click node_activity "https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/ui/MainActivity.kt"
click node_permissions "https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/utils/PermissionManager.kt"
click node_service "https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/service/HandGestureService.kt"
click node_hand "https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/core/HandDetector.kt"
click node_rotation "https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/core/RotationDetector.kt"
click node_volume "https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/utils/VolumeController.kt"
click node_driving "https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/utils/DrivingModeDetector.kt"

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_permissions,node_service,node_user toneBlue
class node_camera,node_hand,node_mediapipe,node_rotation toneAmber
class node_driving,node_gps toneMint
class node_volume,node_audio,node_notification toneRose
```

## Components

### App controls

- [Main activity](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/ui/MainActivity.kt): `app/src/main/java/com/example/handgesturevolume/ui/MainActivity.kt`
- [Permission manager](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/utils/PermissionManager.kt): `app/src/main/java/com/example/handgesturevolume/utils/PermissionManager.kt`
- [Foreground service](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/service/HandGestureService.kt): `app/src/main/java/com/example/handgesturevolume/service/HandGestureService.kt`

### Gesture recognition

- **CameraX analysis**
- [Hand landmark detection](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/core/HandDetector.kt): `app/src/main/java/com/example/handgesturevolume/core/HandDetector.kt`
- **MediaPipe**
- [Rotation analysis](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/core/RotationDetector.kt): `app/src/main/java/com/example/handgesturevolume/core/RotationDetector.kt`

### Driving mode

- [Driving detector](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/utils/DrivingModeDetector.kt): `app/src/main/java/com/example/handgesturevolume/utils/DrivingModeDetector.kt`
- **GPS location**

### Android integrations

- [Volume controller](https://github.com/prol3/volumotion/blob/main/app/src/main/java/com/example/handgesturevolume/utils/VolumeController.kt): `app/src/main/java/com/example/handgesturevolume/utils/VolumeController.kt`
- **Android audio**
- **Persistent notification**

### Other components

- **User**

## Connections

- User → Main activity: operates (evidence: `README.md`)
- Main activity → Permission manager: manages permissions (evidence: `README.md`)
- Main activity → Foreground service: starts and controls (evidence: `README.md`)
- Foreground service → CameraX analysis: analyzes frames (evidence: `README.md`)
- Foreground service → Hand landmark detection: processes frames (evidence: `README.md`)
- Hand landmark detection → MediaPipe: tracks landmarks (evidence: `README.md`)
- Foreground service → Rotation analysis: evaluates motion (evidence: `README.md`)
- Foreground service → Volume controller: changes volume (evidence: `README.md`)
- Volume controller → Android audio: controls audio (evidence: `README.md`)
- Foreground service → Driving detector: monitors driving (evidence: `README.md`)
- Driving detector → GPS location: reads location (evidence: `README.md`)
- Foreground service → Persistent notification: updates notification (evidence: `README.md`)
- Persistent notification → Foreground service: pauses or resumes (evidence: `README.md`)
- Driving detector → Foreground service: triggers monitoring (evidence: `README.md`)
