Android Architecture

ViewModel and Room

A ViewModel survives configuration changes and provides a lifecycle-aware place for screen state. Room provides a structured SQLite abstraction.

  • Repository coordinates data sources.
  • DAO owns database queries.
  • ViewModel exposes UI state.
  • UI observes state and sends user intents.
Lesson complete?Use the next lesson to continue the learning path.