Android Architecture Components (a Jetpack része) olyan könyvtárak, amelyek robusztus, karbantartható alkalmazások létrehozásában segítenek — beleértve a ViewModel (életciklus-tudatos állapot), a LiveData/StateFlow (megfigyelhető adatok) és a Room (adatbázis-absztrakció) komponenseket. Támogatják az ajánlott architektúra-mintákat.
ViewModel — életciklus-tudatos állapot-tároló
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)
