Android Architecture Components (Jetpack चा भाग) हे मजबूत, देखभाल करता येणारी apps बांधायला मदत करणारी लायब्ररीज आहेत — ViewModel (lifecycle-aware state), LiveData/StateFlow (observable data), आणि Room (एक database abstraction) यांचा समावेश आहे. ते शिफारस केलेल्या architecture patterns ला समर्थन देतात.
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)
