Android Architecture Components (Jetpack નો ભાગ) એ લાઇબ્રેરીઝ છે જે મજબૂત, જાળવણીપાત્ર અને્વયપ્રણાલી બનાવવા માટે મદદ કરે છે — જેમાં ViewModel (જીવનચક્ર-સભાન સ્થિતિ), LiveData/StateFlow (અવલોકનક્ષમ ડેટા), અને Room (ડેટાબેસ અબસ્ટ્રેક્શન) શામેલ છે. તેઓ 권장된આર્કિટેક્ચર પ્રતિમાન્ને સમર્થન આપે છે.
ViewModel — જીવનચક્ર-સભાન સ્થિતિ ધારક
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)
