Android Architecture Components (sashe na Jetpack) su yadda a gida gida don gina apps masu ƙarfi da ingantacciyar tsari — ciki da ViewModel (state da fahimtar rayuwar), LiveData/StateFlow (bayanan da ake gani) da Room (asirori na baze-data). Suna tallafa ga tsare-tsareka na gida da Google ta ba da shawarwa.
ViewModel — malami na state da ke fahimtar rayuwar
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)
