Repository navigation
Home
Shivang Sagar edited this page Sep 29, 2026
·
1 revision
Welcome to the comprehensive technical documentation for Presencia, an offline-first Android attendance management utility built with modern declarative UI standards.
Presencia addresses the core need for minimal, privacy-centric class attendance monitoring without intrusive server dependencies or cloud sync overhead.
- Zero Overhead / Frictionless Interaction: One-tap attendance marking with instantaneous UI state updates.
- Strict Privacy & Offline Integrity: No network permissions requested in the manifest; data persists strictly within application-sandboxed storage.
-
High Contrast Accessibility: True OLED black (
#000000) and pure white (#FFFFFF) themes optimized for legibility under bright sunlight and minimal battery drainage. - Longitudinal Date Support: Deterministic, custom grid calendar architecture functioning seamlessly between January 2026 and December 2077.
| Layer | Technology | Details / Rationale |
|---|---|---|
| Language | Kotlin (JVM Target 11) | Null safety, concise state mutability, coroutine readiness |
| UI Toolkit | Jetpack Compose (Material 3) | Declarative UI, state-driven reactivity, zero XML overhead |
| Architecture | MVVM Pattern | Clear separation of UI presentation from business storage |
| Serialization | Google Gson | Lightweight JSON serialization for sandboxed SharedPreferences
|
| Persistence | Android SharedPreferences
|
Native key-value store, instant initialization, deterministic wiping on app uninstall |
| Build System | Gradle Kotlin DSL (build.gradle.kts) |
Declarative build system targeting modern Android compilation |
-
Application ID / Package:
com.shivangsagar.presencia - Minimum SDK: API Level 24 (Android 7.0 Nougat)
- Target / Compile SDK: API Level 37 (Android 16+)
-
Dependencies:
androidx.compose.material3:material3androidx.compose.material:material-icons-extendedandroidx.lifecycle:lifecycle-viewmodel-compose:2.8.6com.google.code.gson:gson:2.10.1
Presencia follows a lightweight Model-View-ViewModel (MVVM) pattern:
┌────────────────────────────────────────────────────────┐
│ UI Layer │
│ (MainActivity -> AppNavigation -> Screen Composables) │
└───────────────────────────▲────────────────────────────┘
│ State Observation
▼
┌────────────────────────────────────────────────────────┐
│ PresenciaViewModel │
│ (State management, mutability triggers, validation) │
└───────────────────────────▲────────────────────────────┘
│ Serialization / Persistence
▼
┌────────────────────────────────────────────────────────┐
│ StorageManager │
│ (Gson String Engine <-> SharedPreferences) │
└────────────────────────────────────────────────────────┘
-
SubjectData:-
id: String(UUID v4 — guarantees unique item identification across deletions) -
name: String(Subject title string) -
attendanceData: MutableMap<String, Boolean>(Date strings in ISO-8601YYYY-MM-DDmapping to attendance status:truefor Present,falsefor Absent)
-
Handles the encoding and extraction of serialized application entities:
-
saveSubjects(List<SubjectData>): Serializes subjects list to JSON format using reflection viaTypeToken. -
getSubjects(): Deserializes the existing records, falling back to an empty list on first application startup. -
saveTheme(Boolean)/getTheme(): Retains user preference for Dark/Light mode between application lifecycles.
Encapsulates runtime data and executes business rules:
-
Subject Creation Validation: Guarded by
isNotBlank()logic to suppress empty dialog submissions. -
Granular Attendance Tracking: Modifies specific date keys in
attendanceDatawithout altering previous records. -
Attendance Removal (
removeAttendance): Strips marked records from the map to restore neutral calendar status. -
Lifecycle Reinitialization: Keyed Compose states (
key(subject.id)) ensure edit dialog fields dynamically bind to the correct subject title, eliminating index-offset visual bugs during batch operations.
-
Dynamic Donut Gauge:
- Utilizes Compose
Canvasdrawing arcs with smoothStrokeCap.Round. - Outer track uses adaptive contrast (
Color(0xFFE0E0E0)in light theme,Color.DarkGrayin dark theme). - Foreground arc sweep maps dynamically via:
Sweep Angle = (Present / Total) * 360
- Utilizes Compose
-
Contextual Action Menus:
- Inline Edit dialog with persistent text fields.
- Single-item removal triggering instant list re-indexing.
-
Global Control TopBar:
- Theme switcher updating system status bar icons and full palette.
- Multi-select toggle transitioning the primary '+' trigger into a bulk-delete confirmation modal.
-
System Back Navigation Handling: Integrated
BackHandlerroutes hardware back actions to return toHomeScreenrather than terminating the application task. -
Custom Calendar Engine:
- Computes starting day offsets dynamically using
java.time.LocalDate.dayOfWeek. - Standard 7-column layout mapping days accurately without heavy third-party calendar libraries.
- Current date emphasized via
FontWeight.Boldand high-contrast double borders.
- Computes starting day offsets dynamically using
-
Four Statistical Metric Nodes:
-
Present Count: Total instances where value evaluates to
true. -
Absent Count: Total instances where value evaluates to
false. -
Total Classes: Dynamic calculation (
Present + Absent). -
Percentage Calculation: Displayed as an integer ceiling/floor percentage (
0%fallback for empty states).
-
Present Count: Total instances where value evaluates to
- Subject Hard Reset: Accessible at the bottom; purges map data for the active subject ID after dual-confirmation dialogue validation.
- Android Studio Ladybug | Jellyfish | Meerkat or newer
- JDK 11 installed and configured in project structure
- Android device or emulator running API 24+
- Clone the repository:
git clone [https://github.com/TUMHARA_USERNAME/Presencia.git](https://github.com/TUMHARA_USERNAME/Presencia.git)
- Open Android Studio and select Open, browsing to the project root directory.
- Allow Gradle to execute build script evaluation and download dependencies.
- Build signed APK or run directly via terminal:
The compiled APK binary will be produced under:
./gradlew assembleReleaseapp/build/outputs/apk/release/
-
Sandboxing: Data saved via
Context.MODE_PRIVATEis isolated from external app inspection on non-rooted devices. - Clean State Guarantee: Application uninstall completely flushes cache and shared preferences via native Android package manager protocols.
- No Telemetry: Zero analytics trackers, background daemons, or internet sockets initialized.