Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Raywenderlich Tutorial Team, Yun Cheng, Aldo Olivares Domínguez

Rating No ratings yet

No description

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide to Android app architecture that rebuilds one sample app through MVC, MVP, and related patterns so you can judge trade-offs yourself. Best for Android developers in Kotlin who already ship apps but want maintainable, testable structure. 【Book Arc】 - **Opening (~0%–10%)**: Sets up the core question — Google long offered no official architecture opinion, so developers must choose among MVC, MVP, MVVM, MVI, and Viper based on app needs. - **Early (~10%–30%)**: Introduces the WeWatch sample app and builds it with MVC, then examines why MVC's controller logic trapped in an Activity resists unit testing. - **Early–Middle (~30%–40%)**: Covers supporting fundamentals — Android Architecture Components (e.g., Room entities and annotations), dependency injection with Dagger, and RxJava/Observer pattern basics. - **Middle (~40%–50%)**: Presents MVP theory — View as entry point, Presenter free of Android framework classes, and View–Presenter interaction through interfaces. - **Middle–Late (~50%+)**: Applies MVP to the sample app, moving data retrieval and deletion out of the Activity and into the Presenter, enabling the unit tests MVC blocked. - **Ending**: Excerpts do not cover the closing chapters, so the full progression beyond MVP cannot be mapped here. 【Key Takeaways】 - **Architecture choice is contextual, not universal** (Opening): The book frames its goal as helping you make an informed decision rather than crowning one pattern, since the right fit depends on the app's needs. - **MVC's fatal flaw on Android is testability** (Early): Controller logic lives inside the Activity, tangled with the lifecycle and framework dependencies, so it cannot be unit tested; only the Model remains testable. - **Unit tests are the practical lens for comparing patterns** (Early): The book prioritizes unit tests because they run fast on the local JVM without Android libraries, unlike slower emulator-based UI or integration tests. - **MVP restructures the event flow** (Middle): The View (Activity/Fragment) becomes the entry point for user input, informs the Presenter, and the Presenter updates the Model and then the View. - **Interfaces decouple Presenter from Android** (Middle): The Presenter talks to a ViewInterface rather than a concrete Activity, keeping framework-specific classes out of testable logic. - **Adapters sit in the View** (Middle): Because a RecyclerView belongs to the View and requires an Adapter, the book keeps the Adapter there despite its bridge-like role. - **Dagger generates injection wiring from annotations** (Early): Marking constructors with @Inject and defining a @Component lets Dagger produce the component class that assembles dependencies for you. - **RxJava implements the Observer pattern** (Early–Middle): Observables notify Observers of state changes in a one-to-many relationship; RxJava executes tasks on the calling thread, a detail worth remembering. 【Reading Tips】 - Deep-read the MVC testing chapter and the MVP theory/sample chapters — they carry the book's central argument about testability. - Skim the Dagger and RxJava chapters if you already use those tools; treat them as setup for the architecture chapters rather than the main event. - Follow the WeWatch sample app across chapters rather than reading patterns in isolation; the comparison only lands when you see the same app rebuilt. - When reading MVP, watch specifically for what moves out of the Activity — that migration is the lesson. - Keep the unit-testing rationale in mind as your evaluation criterion for every pattern you meet. 【Coverage Limits】 This guide is based on stratified excerpts covering roughly the first half of the book (introduction through the MVP sample); later chapters and the book's closing conclusions are not represented, so claims about MVVM, MVI, Viper, or the final recommendations cannot be made.
Excerpt 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Injecting dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
View in text
Excerpt 2
chestrating how the data should be displayed raywenderlich.com 26 Advanced Android App Architectures Chapter 2: Model View Controller Main Screen Open MainAc...
View in text
Excerpt 3
a pattern made up of multiple patterns. In other words, a pattern of patterns. MVC, for example, relies on the Strategy pattern to configure the interaction...
View in text
Excerpt 4
framework-specific classes like Activity in the Presenter. MainActivity extends AppCompatActivity, which is specific to the Android framework and cannot be m...
View in text
Excerpt 5
lDataSource lateinit var mainPresenter : MainPresenter You’ll link these components together in a setUp() method that runs before every test, as denoted by t...
View in text
Excerpt 6
ovie_main, parent, false) return MovieHolder(binding) } Here, instead of calling the traditional LayoutInflater, you’re using DatabindingUtil, which allows y...
View in text
Excerpt 7
ing value for API_KEY with your own. raywenderlich.com 149 Advanced Android App Architectures Chapter 13: MVVM Testing So, instead of running the code in a d...
View in text
Excerpt 8
ject and selecting build.gradle in the root of the project. The starter project contains the basic structure you’ll use for this app, and it contains the fol...
View in text
Tags
AI categories
Programming LanguageSoftwareEducation
ISBN: 1942878699
Publisher: Razeware Llc
Publish Year: 2019
Language: English
Pages: 273
File Format: PDF
File Size: 22.9 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…