Architecture Components: A Better Path Forward (Lifecycle & Live Data)
summary
Shows concrete use of Architecture Components: a LocationMonitor lifecycle-aware wrapper that removes onStart/onResume/onPause boilerplate and a StockLiveData that requests updates only when observers are active. Uses ViewModel, LiveData/MutableLiveData with MutableLiveData.setValue vs postValue, and Transformations.map to derive first-letter data. Claims fewer memory leaks and no manual unregistering; passes Lifecycle optionally and offers a LifecycleRegistry fallback for older code. Notes data binding integration is awkward and a performance question about creating 50 components remains unanswered.
AI-written summary · about
chapters (5)
- 0:00Jonathan Secret
- 4:20Life Cycle
- 21:47Why Should You Use Live Data
- 26:43Mutable Live Data Class
- 37:52Performance of Components
related talks
41mViewModels, LiveData and Lifecycles, oh my!
20mArchitecture Components
44mAndroid Architecture Components, a New Way to Build Apps
45mAndroid Architecture Components Considered Harmful
47mAndroid Architecture Component
30mClean App Design with Architecture Components
33mThe A,B and C of Lifecycle Components
28mInternals of Android Architecture Components
