Android Architecture Components (Teil von Jetpack) sind Bibliotheken, die beim Erstellen robuster, wartbarer Apps helfen — einschließlich ViewModel (Lifecycle-bewusster Zustand), LiveData/StateFlow (beobachtbare Daten) und Room (eine Datenbankabstraktion). Sie unterstützen empfohlene Architekturmuster.
ViewModel — Lifecycle-bewusster Zustandshalter
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)
