Android Architecture Components (sebahagian daripada Jetpack) ialah library yang membantu membina aplikasi yang teguh dan boleh diselenggara — termasuk ViewModel (state yang sedar kitaran hayat), LiveData/StateFlow (data yang boleh diperhatikan), dan Room (abstraksi pangkalan data). Ia menyokong corak seni bina yang disyorkan.
ViewModel — pemegang state yang sedar kitaran hayat
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)
