Building your own Jetpack
summary
Explains how Android Jetpack ViewModel actually decouples UI state from Activity/Fragment lifecycle and shows how to implement the same mechanism: a ViewModelStore tied to Activity that survives configuration changes, a custom ViewModel registry and factory, lifecycle-aware observers, and the rules for scoping to activity vs fragment (and pitfalls with FragmentManager/back stack). Demonstrates a concrete playlists page implemented with the homemade ViewModel system so it survives rotation and navigation, and shows the registry/observer code that makes it work in practice.
AI-written summary · about
chapters (11)
- 0:00Introduction to Jetpack
- 1:05What is Jetpack
- 2:36ViewModel and lifecycle
- 5:03Handling configuration changes
- 8:19Fragment lifecycle deep dive
- 12:22FragmentManager explained
- 17:24Building custom components
- 21:53Real-world Jetpack use cases
- 26:11Debugging and testing
- 30:50Advanced Jetpack features
- 34:08Q&A and closing remarks
