Tag: Architecture
All the articles with the tag "Architecture".
-
Android Starter Pattern and Adapter Click Listener Best Practice
Learn the Android starter pattern — a static factory method that hides Intent keys and enforces required parameters — and why adapters should never open activities directly, using a higher-order function as an item click listener instead.
-
Android LiveData — Observable, Lifecycle-Aware, and the Two-Variable Pattern
Understand LiveData's two core properties — observable data holder and lifecycle-aware delivery — the difference between setValue and postValue, and why ViewModel uses a private MutableLiveData with a public LiveData to enforce MVVM boundaries.
-
Android ViewModel Internals — ViewModelProvider, ActivityThread, and the Factory Pattern
Understand the full internal chain of Android's ViewModel — how ViewModelProvider, ComponentActivity, NonConfigurationInstance, ViewModelStore, and ActivityThread work together across three lifecycle scenarios, and when a ViewModelFactory is required.
-
Android ViewModel Internals — Why Data Gets Lost on Rotation and How to Fix It
Build a ViewModel from scratch to understand why Android data is lost on orientation change, how storing it in the Application class fixes one problem but introduces another, and the two rules every ViewModel must follow.