background_runtime_android
Android implementation of the background_runtime Flutter plugin.
Uses Kotlin coroutines, Foreground Service, Media3 ExoPlayer, OkHttp, and SQLite.
Supports Android API 24+.
Capabilities
- Downloads: OkHttp async downloads with resume support (
Range:header +FileOutputStreamappend). Progress callbacks viaEventChannel. - Audio playback: Media3 ExoPlayer with
MediaSessionfor lock screen controls. Album art downloaded and cached asBitmap, dominant color extracted from 3×3 pixel grid. - Notifications: Foreground Service notification with 4 action buttons (Previous, Play/Pause, Next, Stop). Album art as
setLargeIcon(), colorized viasetColor()(API 31+). - Notification actions:
NotificationActionenum values sent to Dart vianotificationActionEventsEventChannel. Handler-based main-thread dispatch. - Persistence: Room database (downloads, audio tracks, config). Auto-resume on initialize.