
Learn how to correctly use coroutines to manage concurrency, fix mistakes that enable UI interactions during a long running benchmark, and ensure a suspending function completes before UI state updates.
Learn how to cancel coroutines in Android by tracking a job from launch, canceling it on stop, and understanding collaborative cancellation with withContext.
Work through exercise three by timing the get reputation for user flow in a fragment, showing elapsed time in a text view, and managing two concurrent coroutines with cancellation on stop.
Explore how to cancel a coroutine scope by canceling the entire scope versus its children, and learn when to apply each approach in Kotlin for Android.
Learn to manage coroutines inside a ViewModel, distinguishing canceling scope children from canceling the entire scope. See how onCleared cancels remaining coroutines to prevent memory leaks during navigation.
Cancel children using coroutine context cancelChildren; this cancels all child coroutines, while canceling the entire scope disables future launches. Avoid full scope cancellation to prevent silent failures and tricky bugs.
Design clean, maintainable Android code by keeping presentation logic on the UI thread, and use case classes to encapsulate concurrent flows across MVC, MVVM, and MVP patterns.
Explore the unconfined dispatcher in Kotlin coroutines, observing immediate execution on the calling thread often the main thread, and why Android apps should avoid it.
Explore how non-cancellable blocks break the job hierarchy, how cancellation signals propagate in with context, and how structured concurrency remains intact in coroutine hierarchies.
Learn how to convert sequential steps into parallelized algorithms using coroutines for practical Android applications. Understand that concurrency and parallelism are effectively the same for most practical use.
The lecture explains implementing parallel decomposition in fetch and cache users to run per-user tasks concurrently, handling coroutine cancellation safely, and fixing a bug related to elapsed time updates.
Explore parallel decomposition with Kotlin coroutines to speed Android apps, using launch for side effects and async for results, while avoiding shared mutable state to prevent concurrency bugs.
Explore how CoroutineExceptionHandler governs uncaught exceptions in Kotlin coroutines, with unit-test demos showing installation in coroutine context and the difference from Android's default crash behavior.
Propagate the exception from the login use case to the coroutine scope in exercise ten and handle it at the scope level to prevent crashes and keep the app functional.
learn the correct way to handle exceptions in coroutines by catching timeouts inside the login use case, preventing propagation to the presentation layer.
This course is your complete guide into the world of Kotlin Coroutines in Android. By the end of this course, you'll know how to use Coroutines to write reliable, maintainable and responsive Android applications.
The philosophy of this course is "learn by coding", so you'll be asked to solve a series of carefully designed, hands-on exercises. These exercises are built into a tutorial Android application, so they accurately reflect the "real world" use cases that you'll encounter in real Android apps.
Even though the main goal of this course is to give you practical skills, it also covers the theory behind Kotlin Coroutines framework at a more conceptual level. In particular, you're going to learn what Structured Concurrency is, what benefits it provides and how Coroutines support this powerful paradigm.
These aspects of Kotlin Coroutines framework are covered in this course:
Coroutines as concurrency framework
Suspending vs blocking functions
Coroutine Scope, Context and Jobs hierarchy
Coroutines cancellation
Exceptions handling inside Coroutines
Structured Concurrency
Unit testing with Coroutines
and more...
In this course we go beyond the functionality of Kotlin Coroutines framework itself and also discuss important design considerations that will help you write clean and maintainable code.
Knowledge of Kotlin Coroutines is an essential skill for Android developers. After completing this course, you'll be able to use Coroutines in real-world Android projects, and you'll be ready to answer even the trickiest questions about this framework in job interviews.
So, if you're serious about Android development and you want to master Kotlin Coroutines, this course is perfect for you!