Android Architecture Components (Jetpack का हिस्सा) ऐसी libraries हैं जो robust, maintainable apps बनाने में मदद करती हैं — जिनमें ViewModel (lifecycle-aware state), LiveData/StateFlow (observable data), और Room (एक database abstraction) शामिल हैं। ये recommended 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)
