Lifecycle-Aware Components in Android

Learn about lifecycle-aware components including what they are, how they work & how to create your own components and test them. By Sriyank Siddhartha.

Leave a rating/review
Download materials
Save for later
Comments
Share

Who is this for?

This course is designed for developers who already know the basics of Android app development using Kotlin and want to leverage the power of Android Jetpack by incorporating Lifecycle-Aware components into their apps.

Covered concepts

  • Lifecycles in Android
  • Lifecycle-aware components
  • Lifecycle observers
  • Events and states
  • Lifecycle owners
  • LiveData
  • Test a lifecycle-aware component

Part 1: Lifecycle-Aware Components in Android

01
Toggle description

Get a quick overview of the AwarenessFood app with setting up the API key from the Spoonacular API.

Toggle description

Explore what a lifecycle-aware component is, and understand what problem it solves in your app.

Toggle description

Create your first lifecycle-aware component and understand what exactly is a lifecycle owner and observer.

Toggle description

Explore how to make a lifecycle observer react to the lifecycle events of a lifecycle owner.

Explore when a lifecycle owner emits its lifecycle events to its observers.

Toggle description

State holds the current lifecycle state of the lifecycle owner. Explore how to execute code in a lifecycle observer when the lifecyle owner is at least in a certain lifecycle state.

Toggle description

Learn how to make a lifecycle-aware component react to the lifecycle changes of the Application class.

Toggle description

Explore how to create your own custom lifecycle owner by implementing LifecycleOwner interface and emit events to its observers.

Toggle description

Explore how to make a lifecycle-aware component subscribe to the lifecycle events of a custom lifecycle owner.

LiveData is an in-built lifecycle-aware component found in Android. Explore its significance and how to use it.

Toggle description

Explore how to use LiveData with a Fragment and update the UI.

Toggle description

Writing a test case is a crucial part of the development process. Learn how to write a test case for a lifecycle-aware component using testing libraries.