February 22nd, 2026
The Native Scheduler & Global UI Optimization Today was a massive architectural shift deep within the Android Native layer, focusing on reliable scheduling, device boot recovery, and optimizing the React Native UI layer.Native Scheduler Architecture
We completely revamped how alarms are scheduled and triggered natively:- Simplified Alarm Logic: Nuked the complex legacy scheduling in favor of a clean baseline. We implemented
AlarmSchedulerto query the local Expo SQLite DB directly for the next upcoming valid task instance. - Android AlarmManager API: Integrated
AlarmManager(Exact/Clock) to schedule native OS triggers that persist through app swipes and deep doze states. - Alarm Receiver & Activity: Created
AlarmReceiverandAlarmActivityto handle the wake-up intent and display a basic lock-screen UI. - Alarm Chaining & Media: Wired the
DISMISSbutton inAlarmActivityto instantly schedule the next chronological alarm. The Activity now plays the system’s default alarm ringtone and vibrates continuously. We also directly update the local SQLite DB (markInstanceProceeded) when an alarm is dismissed. - Boot Recovery: Implemented
BootReceiverrecovery to automatically callAlarmScheduler.scheduleNextAlarm()on device restart, ensuring alarms survive reboots. - Lock-Screen Bypassing: Switched to a dedicated native
AndroidManifest.xmlwithin the module (removing the legacywithAlarmPermissionsconfig plugin). We addedturnScreenOn,showWhenLocked, andkeepScreenOntoAlarmActivityto ensure the screen wakes up and bypasses the keyguard on Android 10+.BootReceiver,AlarmReceiver, andAlarmActivitywere marked withdirectBootAware="true".
Pre-Alarms & Telemetry
- Engineered a deeply integrated native Pre-Alarm system mapping staggered event triggers (-15m, -13m… -1m).
- Added extensive trace block logging across all Kotlin files for lifecycle observability.
- Rewrote Android OS Window Manager configuration logic in
AlarmActivityto differentiate dynamic ‘Pre-Alarm’ countdown typography vs ‘Main-Alarm’ execution displays. - Comprehensively refactored all Kotlin files to use professional telemetry markers and extensive KDoc architectural comments.
Global UI Optimization
We also achieved sub-millisecond tap-to-render latency on calendar events:- Root Migration: Moved
EventDetailModalfrom individual tab screens up to the root tab navigator_layout.tsx. - View Hierarchy Optimization: Prevented React Navigation from mounting multiple identical modal components simultaneously across active tabs, mitigating Android view hierarchy conflicts.
- Render Cycle Decoupling: Unsubscribed
schedules.tsxfrom reading the modal’s Zustand state. It now uniquely imports the setter, allowing instantaneous modal triggering without forcing a re-render of the heavy calendar instance. - Added extensive JSDoc architectural comments and structural diagrams detailing the Singleton architecture in the Root Layout and the native map interface in
location-set.tsx.