# fiqnadzrii/honeybee architecture

> Architecture diagram of the GitHub repository fiqnadzrii/honeybee, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fiqnadzrii/honeybee
- Repository: https://github.com/fiqnadzrii/honeybee

## Overview

##### Project type and purpose
- This is a native Android educational game app (“HoneyBee”) written in Java, built with Android Studio.
- Purpose: teach ages 7–12 the stages of honey production through interactive, arcade-style gameplay, quizzes, multimedia, and OpenCV-powered visual interactions.

##### File structure
- Top-level “app” module contains build.gradle, ProGuard rules, and all source/assets.
- src/main/java/com/example/honeybee – UI Activities (MainActivity, LevelXActivity, PlayActivity, SettingsActivity), custom views (GameView, Level2GameView), and GameAudioManager.
- src/main/res – layouts for each Activity/dialog, raw assets (audio, video), drawables, mipmaps, XML rules.
- Tests under androidTest and test.
- Gradle files declare dependencies (likely OpenCV for Android, standard AndroidX libs).

##### README for additional insights
- Core technologies: Java, Android XML layouts, MediaPlayer for audio/video, custom rendering via GameView, OpenCV for visual interactions.
- Features include real-time game logic, collision detection, multimedia presentation, quizzes, and educational dialogs.

##### Detail is critical
- Be exhaustive: include all six Activities, the two GameView classes, audio manager, and OpenCV interface.
- Lifecycle events where relevant (e.g., Activity → GameView.onResume / onPause).

## Diagram (Mermaid)

```mermaid
graph TB
    %% External actor
    User["User (touch, buttons)"]:::external

    %% Android Framework
    AndroidFW["Android Framework & OS"]:::androidComp

    %% UI Layer
    subgraph "UI Layer"
        direction TB
        MainActivity["MainActivity"]:::androidComp
        LevelsActivity["LevelsActivity"]:::androidComp
        Level1Activity["Level1Activity"]:::androidComp
        Level2Activity["Level2Activity"]:::androidComp
        Level3Activity["Level3Activity"]:::androidComp
        PlayActivity["PlayActivity"]:::androidComp
        SettingsActivity["SettingsActivity"]:::androidComp
    end

    %% Game Engine Layer
    subgraph "Game Engine"
        direction TB
        GameView["GameView"]:::custom
        Level2GameView["Level2GameView"]:::custom
    end

    %% Audio/Video Engine
    GameAudioManager["GameAudioManager"]:::custom

    %% OpenCV Module
    OpenCV["OpenCV Module"]:::extLib

    %% Resource Manager
    ResourceManager[(Resource Manager)]:::resource

    %% Tests
    subgraph "Tests"
        direction TB
        InstrumentedTest["ExampleInstrumentedTest"]:::test
        UnitTest["ExampleUnitTest"]:::test
    end

    %% Relationships
    User -->|"touch, button events"| MainActivity
    User -->|"touch, button events"| LevelsActivity
    User -->|"touch, button events"| Level1Activity
    User -->|"touch, button events"| Level2Activity
    User -->|"touch, button events"| Level3Activity
    User -->|"touch, button events"| PlayActivity
    User -->|"touch, button events"| SettingsActivity

    MainActivity -->|"forwards events"| GameView
    Level2Activity -->|"forwards events"| Level2GameView

    GameView -->|"load sprites, sounds, videos"| ResourceManager
    Level2GameView -->|"load sprites, sounds, videos"| ResourceManager

    GameView -->|"trigger play/pause"| GameAudioManager
    Level2GameView -->|"trigger play/pause"| GameAudioManager

    GameView -->|"send frames"| OpenCV
    OpenCV -->|"detection results"| GameView

    GameAudioManager -->|"status callbacks"| PlayActivity

    LevelsActivity -->|"load quiz/dialog content"| ResourceManager
    Level1Activity -->|"load quiz/dialog content"| ResourceManager
    Level2Activity -->|"load quiz/dialog content"| ResourceManager
    Level3Activity -->|"load quiz/dialog content"| ResourceManager
    SettingsActivity -->|"load settings layouts"| ResourceManager

    %% Android Framework integration
    AndroidFW --> MainActivity
    AndroidFW --> GameView
    AndroidFW --> OpenCV

    %% Testing relationships
    InstrumentedTest --> MainActivity
    UnitTest --> GameView

    %% Click Events
    click MainActivity "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/MainActivity.java"
    click LevelsActivity "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/LevelsActivity.java"
    click Level1Activity "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/Level1Activity.java"
    click Level2Activity "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/Level2Activity.java"
    click Level3Activity "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/Level3Activity.java"
    click PlayActivity "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/PlayActivity.java"
    click SettingsActivity "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/SettingsActivity.java"
    click GameView "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/GameView.java"
    click Level2GameView "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/Level2GameView.java"
    click GameAudioManager "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/java/com/example/honeybee/GameAudioManager.java"
    click AndroidManifest.xml "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/main/AndroidManifest.xml"
    click buildGradle "https://github.com/fiqnadzrii/honeybee/blob/master/app/build.gradle"
    click ResourceManager "https://github.com/fiqnadzrii/honeybee/tree/master/app/src/main/res/layout/"
    click ResourceManager "https://github.com/fiqnadzrii/honeybee/tree/master/app/src/main/res/drawable/"
    click ResourceManager "https://github.com/fiqnadzrii/honeybee/tree/master/app/src/main/res/mipmap-*/"
    click ResourceManager "https://github.com/fiqnadzrii/honeybee/tree/master/app/src/main/res/raw/"
    click InstrumentedTest "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/androidTest/java/com/example/honeybee/ExampleInstrumentedTest.java"
    click UnitTest "https://github.com/fiqnadzrii/honeybee/blob/master/app/src/test/java/com/example/honeybee/ExampleUnitTest.java"

    %% Styles
    classDef androidComp fill:#ADD8E6,stroke:#067b8c,stroke-width:2px
    classDef custom fill:#90EE90,stroke:#2e8b57,stroke-width:2px
    classDef extLib fill:#FFA500,stroke:#cc8400,stroke-width:2px
    classDef resource fill:#D3D3D3,stroke:#888888,stroke-width:2px
    classDef test fill:#DDA0DD,stroke:#a64ca6,stroke-width:2px
    classDef external fill:#FFFFFF,stroke:#000000,stroke-dasharray:5 5,stroke-width:1px
```
