Spotui Architecture: Building a High-Performance Jetpack Compose Music Client
An engineering deep-dive into how Spotui manages reactive UI recomposition, ExoPlayer audio pipelines, and SpotiFLAC lossless track resolving.

Architectural Overview
Developing mobile applications for digital audio playback presents unique software engineering challenges. Unlike standard CRUD applications, a music player operates continuously in the background while managing complex state synchronization between online servers, local caches, and OS-level media notifications.
Spotui is engineered natively for Android using Kotlin 2.0 and Jetpack Compose. By discarding legacy XML layout views, the entire application relies on state-driven recomposition to render UI components at a silky 120Hz refresh rate.
"Declarative UI allows us to treat the player state as a single source of truth. When the audio engine updates the track position, only the relevant progress composables recompose."
Reactive State with Jetpack Compose
In traditional Android development, updating a player screen required finding views by ID (`findViewById`) or binding data across complex lifecycles. Spotui utilizes Unidirectional Data Flow (UDF). The UI emits user intent events to a ViewModel layer.
Key UI advantages include:
- Zero UI Lag: Asynchronous state updates via Kotlin StateFlow eliminate main thread blocking.
- Dynamic Palette Extraction: Album artwork is analyzed on-the-fly to calculate ambient dark gradient backgrounds.
- Millisecond Lyrics Rendering: Real-time lyric line tracking triggers precise composable animations without dropping frames.
💡 ExoPlayer Integration: Media playback is powered by Android's modern Media3 pipeline, guaranteeing seamless background audio execution even when the app is minimized.
Audio Engine & ExoPlayer Media3
Audio playback is orchestrated by a dedicated Foreground Service running ExoPlayer Media3. This handles buffering, seamless track transitions, and audio focus changes (such as pausing when a phone call arrives).
FLAC Track Resolving Pipeline
For high-fidelity audio streams, Spotui incorporates SpotiFLAC track resolving logic. Instead of default lossy 160kbps streams, the engine resolves bit-perfect 24-bit 192kHz FLAC audio sources where available, delivering uncompressed studio quality directly to your headphones.
Conclusion & Future Roadmap
Spotui proves that open-source Android development can deliver a sleek, commercial-grade user experience while maintaining complete user privacy and zero advertising.
Ready to Experience Spotui?
Download the latest official Android release and enjoy ad-free music.