finds.dev← search

// the find

guolindev/coolweatherjetpack

★ 2,255 · Kotlin · Apache-2.0 · updated Sep 2023

酷欧天气的Jetpack版本实现,采用了MVVM架构。

A Kotlin Android weather app that reimplements the author's earlier 'Cool Weather' project using Jetpack components and MVVM. It's a teaching example from a well-known Chinese Android book author, not a production app — the point is the architecture pattern, not the weather features.

The layered architecture is genuinely clean: UI → ViewModel → Repository → (Room or Network) with strictly unidirectional references and no layer skipping. The repository handles the local-vs-network decision transparently, which is exactly how this pattern should work. Retrofit + coroutines wiring is straightforward and easy to follow as a reference implementation. The architecture diagram in the README is a real asset — it maps 1:1 to the code structure.

Last pushed September 2023 and the dependency versions are stale — the old HeWeather API it calls is long deprecated and you can't actually run this app without finding a replacement data source. It uses LitePal for local persistence instead of Room, which is an odd choice for a Jetpack showcase given Room is the obvious Jetpack-native answer. No dependency injection framework (Hilt/Koin) — factories and `InjectorUtil` are wired by hand, which is fine for learning but shows its age. The test directory has only the default scaffolded tests; there's no actual test coverage despite the code being simple enough to unit test.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →