Android Architecture Components (del av Jetpack) er biblioteker som hjelper til med å bygge robuste, vedlikeholdbare apper — inkludert ViewModel (livssyklus-bevisst tilstand), LiveData/StateFlow (observerbar data), og Room (en databaseabstraksjon). De støtter anbefalte arkitekturmønstre.
ViewModel — livssyklus-bevisst tilstandsholder
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)
