Android Architecture Components (onderdeel van Jetpack) zijn bibliotheken die helpen om robuuste, onderhoudbare apps te bouwen — inclusief ViewModel (lifecycle-aware state), LiveData/StateFlow (observable data), en Room (een database abstraction). Ze ondersteunen aanbevolen architectuurpatronen.
ViewModel — lifecycle-aware state holder
VIEWMODEL holds UI-related state and logic, SURVIVING configuration changes:
→ state stored in a ViewModel SURVIVES screen rotation (the activity recreates, but the
ViewModel persists) → solves the lost-state-on-rotation problem
→ separates UI logic from the Activity/Fragment (the View just observes/displays)
