# giorgosneokleous93/fullscreenintentexample architecture

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

- Interactive diagram: https://gitdiagram.com/giorgosneokleous93/fullscreenintentexample
- Repository: https://github.com/giorgosneokleous93/fullscreenintentexample

## Overview

##### Project type and purpose
- Type: Native Android application demo.
- Purpose: Showcase how to schedule and display full‐screen intent notifications (e.g., an incoming‑call UI) on the lock screen.

##### File structure
- Single Gradle module under app/ with standard Android subfolders:
– src/main/java/... contains Kotlin classes: MainActivity, FullScreenActivity, LockScreenActivity, NotificationReceiver, ActivityUtils, ScheduleUtils, Utils
– src/main/res holds layouts (activity_main.xml, activity_full_screen.xml, activity_lock_screen.xml), drawables, mipmaps, values.
- build.gradle scripts configure the Android build, ProGuard rules, and dependencies.
- androidTest/ and test/ for instrumentation and unit tests.

##### README
- Confirms it’s a companion demo for a blog post about full‑screen intent notifications.
- No external backend or third‑party services—interaction with Android OS services only.

##### Main components & relationships
– Android OS services:
- AlarmManager (schedules alarms)
- NotificationManager (posts notifications)
- KeyguardManager / WindowManager (manages lock‑screen display)
– App components:
- MainActivity
- ScheduleUtils (helper to set alarms via AlarmManager)
- NotificationReceiver (BroadcastReceiver triggered by AlarmManager)
- Utils & ActivityUtils (helper functions for building notifications and setting window flags)
- FullScreenActivity (the activity launched by the full‑screen intent)
- LockScreenActivity (optional activity to handle lock‑screen UI)
– User (end‐user interacting with the UI)

b. Interactions / data flow:
1. User opens MainActivity → taps “Schedule Notification.”
2. MainActivity calls ScheduleUtils → schedules an alarm in AlarmManager.
3. AlarmManager fires at the scheduled time → broadcasts an intent.
4. NotificationReceiver receives the broadcast → uses NotificationManager to post a notification with a full‑screen PendingIntent.
5. Android’s Notification Service displays the notification. If the device is locked (or high‑priority), the full‑screen intent automatically launches FullScreenActivity.
6. FullScreenActivity (and potentially LockScreenActivity) uses ActivityUtils/Utils to set window flags, show over lock screen, and handle user interaction.

c. Architectural patterns / principles:
– Separation of concerns via helper classes (ScheduleUtils, ActivityUtils).
– Android component-based architecture (Activities + BroadcastReceiver).
– Loose coupling between scheduling logic and notification presentation.

d. Key technologies & frameworks:
– Kotlin language
– Android SDK (AlarmManager, NotificationManager, PendingIntent, BroadcastReceiver)
– Gradle build system
– AndroidX (if used via build.gradle – check dependencies)

##### Key points to capture
- All Android components and OS services involved.
- Sequence of events from user action to UI display.
- Window‐flag usage for lock‐screen override.
- Helper utilities as separate modules to highlight modularity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User interaction
    User((User)):::user
    User -->|opens| MA

    subgraph "App Module"
        MA["MainActivity"]:::ui
        SS["ScheduleUtils"]:::util
        NR["NotificationReceiver"]:::app
        AU["ActivityUtils"]:::util
        UT["Utils"]:::util
        FS["FullScreenActivity"]:::ui
        LS["LockScreenActivity"]:::ui
        Mf["AndroidManifest"]:::app
        LM["activity_main.xml"]:::res
        LFS["activity_full_screen.xml"]:::res
        LLS["activity_lock_screen.xml"]:::res
    end

    subgraph "Android OS / System Services"
        AM["AlarmManager"]:::os
        NM["NotificationManager"]:::os
        KM["KeyguardManager / WindowManager"]:::os
    end

    %% Data flow
    MA -->|"scheduleNotification() / scheduleAlarm()"| SS
    SS -->|"set alarm"| AM
    AM -->|"broadcast Intent"| NR
    NR -->|"onReceive() / notify()"| NM
    NM -->|"launchFullScreenIntent()"| FS
    FS -->|"setWindowFlags()"| AU
    FS -->|"useHelpers()"| UT
    FS -->|"show over lock screen"| KM
    %% Optional lock screen activity
    FS -->|"optional navigation"| LS

    %% Click Events
    click MA "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/java/com/giorgosneokleous/fullscreenintentexample/MainActivity.kt"
    click FS "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/java/com/giorgosneokleous/fullscreenintentexample/FullScreenActivity.kt"
    click LS "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/java/com/giorgosneokleous/fullscreenintentexample/LockScreenActivity.kt"
    click NR "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/java/com/giorgosneokleous/fullscreenintentexample/NotificationReceiver.kt"
    click SS "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/java/com/giorgosneokleous/fullscreenintentexample/ScheduleUtils.kt"
    click AU "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/java/com/giorgosneokleous/fullscreenintentexample/ActivityUtils.kt"
    click UT "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/java/com/giorgosneokleous/fullscreenintentexample/Utils.kt"
    click Mf "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/AndroidManifest.xml"
    click LM "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/res/layout/activity_main.xml"
    click LFS "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/res/layout/activity_full_screen.xml"
    click LLS "https://github.com/giorgosneokleous93/fullscreenintentexample/blob/main/app/src/main/res/layout/activity_lock_screen.xml"

    %% Styles
    classDef os fill:#d3d3d3,stroke:#333,stroke-width:1px;
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px;
    classDef util fill:#90EE90,stroke:#333,stroke-width:1px;
    classDef app fill:#f0e68c,stroke:#333,stroke-width:1px;
    classDef res fill:#FFDAB9,stroke:#333,stroke-width:1px;
    classDef user fill:#FFFFFF,stroke:#333,stroke-width:1px;
```
