Managing LifeCycle and ViewModel Data
Learn the skills necessary to effectively maintain activity state and simplify coordination with the activity lifecycle using the Android Architecture Componets' ViewModel, Lifecycle, and other related types.
What you'll learn
Effectively managing Android activity state and coordinating the lifecycle of components within an activity are essential to providing a high-quality and consistent user experience; however, doing so can sometimes be a challenge. In this course, Android Apps with Kotlin: ViewModel and Lifecycle, you’ll learn how to use the Android Architecture Components’ ViewModel, Lifecycle, and other related types to deliver just such an experience. First, you'll see how to use ViewModel to simplify managing activity-related data and maintain consistent access to that data even when the system recreates the activity in response to device orientation changes. After that, you'll explore how to use ViewModel in cooperation with onSaveInstanceState to assure a more consistent user experience when moving between apps. Next, you'll discover how to leverage Lifecycle events to simplify coordination between life cycle dependent components and the activity that uses them. Finally, you’ll delve into Lifecycle states to create more flexible, easier-to-use life cycle dependent components. By the end of this course, you'll have the necessary skills and knowledge to create Android apps of your own that provide a high-quality and consistent user experience with the Android Architecture Components’ ViewModel, Lifecycle, and other related types.
Table of contents
- Version Check 0m
- Introduction 2m
- Activities - More Than Just a Pretty Face 3m
- Managing Activity State with ViewModel 4m
- There's a Bug in Our App 4m
- Adding a ViewModel and Build Dependencies 5m
- Accessing Our ViewModel with a Lazy Property 5m
- Restoring the Activity State 4m
- That Bug's Fixed, but We Just Found Another One 3m
- Managing More Complex State with ViewModel 4m
- Verifying App Behavior 2m
- Summary 2m
- Introduction 1m
- Cooperating with Activity Lifecycle 3m
- Our App's Get-together Feature 2m
- Managing Location with Activity Functions 4m
- Fixing the Location Resource Leak 3m
- Improving Lifecycle Handling with Events 4m
- Creating a Lifecycle Observer 3m
- Observing Lifecycle Events 3m
- Connecting the Observer to the Lifecycle 3m
- Summary 2m