Skip to content

Latest commit

 

History

History
18 lines (9 loc) · 737 Bytes

File metadata and controls

18 lines (9 loc) · 737 Bytes

What Room does (Entity – DAO – Database – Repository – ViewModel – UI)

Room persists weather data: Entity defines table rows, DAO declares queries, AppDatabase provides the database, Repository wraps DAO, ViewModel exposes flows, and the UI observes ViewModel state.

Project structure

Project structure: network/ data/ repository/ ui/ (MainActivity + ViewModel) and build configuration in build.gradle.kts.

How data flows

Data flow: user enters city -> ViewModel fetches network -> on success ViewModel calls Repository -> Repository/DAO insert into Room -> UI observes entries via StateFlow.

Cache / caching logic

Cache logic: Room stores each successful fetch.

https://www.youtube.com/watch?v=68mz5bO9Plw