What You'll See in This Demo
📍 Video Timestamps
0:00-0:30
App launch and service start - Foreground notification appears
0:30-1:00
Foreground notification visible in notification shade
1:00-2:00
Real-time data sync - Sending and receiving notifications
2:00-2:30
Background operation - Service continues while app is backgrounded
2:30-3:00
Service stop - Foreground notification disappears
Key Features Demonstrated
- Foreground Service: Persistent notification indicating active connection
- Real-time Sync: Instant notification delivery via WebSocket
- Data Transfer: Messages synced from ntfy.sh server to local database
- Background Operation: Service continues running when app is backgrounded
- User Control: Easy start/stop via app interface
- TV Optimization: Remote control navigation and large UI elements
Technical Details
Foreground Service Type: dataSync
Purpose: Maintains persistent WebSocket connection to receive real-time notification data from ntfy.sh servers
Data Flow:
- Receives notification messages via WebSocket (data download)
- Saves received messages to local Room database
- Displays notifications via overlay or system notifications
- Syncs subscription status with server
Why Foreground Service?
The app requires a foreground service because:
- Real-time notifications need persistent WebSocket connection
- WorkManager cannot be used (15-minute minimum interval vs. instant delivery)
- Users expect immediate notification delivery (home automation, server alerts)
- Foreground notification keeps users informed of active monitoring