
Develop expert knowledge of Kotlin coroutines from foundational theory to advanced concepts, with practical Android projects using MVVM, Retrofit, Room, and coroutine flows.
Install and set up IntelliJ IDEA and Android Studio to explore Kotlin concepts; use IntelliJ IDEA for isolated Kotlin tests and Android Studio to build apps.
Understand the Udemy review system and its impact on course visibility. Learn to request constructive feedback and five-star reviews to improve the complete Kotlin coroutines development course.
Explore the foundations of coroutines, covering creation, manipulation, scope, suspending functions, jobs, and contexts, with practical examples and exception handling for Android development.
Discover how Kotlin coroutines offer lightweight, easily managed asynchronous code, by using thread pools, scopes, contexts, suspending functions, jobs, deferred, dispatchers, and straightforward error handling.
Demonstrate how lightweight Kotlin coroutines are by starting up to a million coroutines that print simple messages, with negligible resource impact compared with threads that crash.
Explore scope concepts in Kotlin coroutines, including global scope, runBlocking, and coroutine scope, and learn how each starts, blocks, and completes coroutines in a program.
Explore how coroutine context relates to scope, using dispatcher and job to control a coroutine's lifecycle, with examples in global scope and run blocking.
Explore how suspending functions run in a coroutine to enable seamless callbacks and easy access to main-thread variables, illustrated by counting function calls with coroutines and global scope launch.
learn how a job represents a coroutine, how launch returns a job, and how a hierarchy of parent and child jobs cancels its members together with invokeOnCompletion.
Learn how dispatchers assign coroutines to threads and thread pools, including main, default, io, unconfined, and new single thread context, for ui, cpu, and io tasks.
Learn how async launches a coroutine and returns a deferred result, then await values with the blocking await function from two suspend functions to compute their sum.
Learn how withContext efficiently switches coroutine context between default, io, and main dispatchers to perform heavy processing and then publish results to the UI.
Compare exception handling for launch and async in coroutines, noting hierarchy propagation and surface when awaiting results; apply coroutine exception handlers and try-catch for robust error management.
Build a small Android app that downloads an image on a background thread with coroutines, then applies a black-and-white filter on another dispatcher, and shows it in an image view.
Set up the kotlin coroutines project in android studio, review the manifest and layout, and learn to download an image with coroutines and apply a black-and-white filter off main thread.
Learn to download an image with Kotlin coroutines by fetching a bitmap on the IO dispatcher and displaying it in the UI via a main-thread image view, with progress feedback.
Complete this challenge by implementing a second coroutine that applies the filter using the filter apply function on the original image and displays the result in the UI.
Apply a black-and-white filter to a bitmap with a coroutine on the default dispatcher, averaging RGB values, then display the filtered image on the main thread.
Explore building an Android app that downloads country data from an endpoint using Retrofit and coroutines, displayed in a RecyclerView with MVVM architecture.
Set up an Android project with MVVM structure, a recycler view displaying country data, and prepare Retrofit and coroutines integration to fetch from a backend API.
Set up Retrofit in a Kotlin coroutine project by adding dependencies, creating a Countries API interface and service, and configuring a converter factory with serialized names for country data.
Implements a retrofit-backed country fetch in a viewmodel using a coroutine scope with io and main dispatchers, handling success and error cases, and canceling the job on viewmodel clearance.
Learn to create, read, and delete data in a Room database using Coroutines, with MVVM architecture and LiveData for asynchronous, real-world app navigation.
Set up an mvvm app with navigation across sign up, login, and main screens, and prepare to implement room database access with coroutines for user management.
Set up the signup fragment and hook it to the ViewModel, validating inputs, showing toasts, and invoking a coroutine-based signup flow that saves data and navigates to the main screen.
Integrate Kotlin coroutines with Room by using suspend DAO methods, an IO dispatcher in the Signup ViewModel, hashing passwords, and updating the UI on the main dispatcher.
Set up main fragment with sign out and delete user flows, including an alert dialog before deletion, and navigate to the sign up screen after sign out with a toast.
Implement sign out and delete user in the main view model using a coroutine scope and database access object, updating login state and UI via the main dispatcher.
Take on a challenge to implement the login screen and login viewmodel, mirroring the signup flow, validating user existence and password correctness with coroutines.
Implement the login fragment to collect username and password, validate fields, and call login in the view model. On success, navigate to main screen; on error, show a toast.
Implement a login view model using coroutines and Room to verify a user, handle not found and incorrect passwords, and update the UI via the main dispatcher.
Discover asynchronous flow in Kotlin coroutines, learn how flows emit values and connect to receivers, and apply properties, operators, buffering, and mixing of flows while mastering exception handling.
Explore asynchronous flow as a stream of values emitted by a coroutine. Build flows with flow, emit values, and collect them to start processing, using a primes example with delays.
Learn how to create flows with a flow builder by emitting values, convert a collection to a flow, and generate flows from var arg parameters.
Learn how flows are cold and only emit when collect is invoked, and how cancellation of the surrounding coroutine cancels the flow, as demonstrated with a delayed, timed emission.
Explore map, filter, and transform operators for Kotlin flows, transforming input flows into output flows. Register operators and start execution with collect to emit varied values.
Explore essential Kotlin coroutines flow operators, including take, toList, toSet, reduce, and flow on, with practical examples of restricting, converting, reducing, and switching dispatchers.
Discover how buffering in Kotlin flows stores generated values in a queue to handle a faster emitter than the collector, reducing delays and improving performance.
Learn to compose multiple Kotlin flows using zip and combine to create coherent programs, matching corresponding values or latest values across flows.
Master exception handling for flows by using try catch, the catch operator, and on completion to guard against errors and report completion status.
Explore building an Android app using Kotlin Coroutines Flow to update the UI, fetch data with Retrofit, and implement MVVM architecture to display news items in a RecyclerView.
Download the starter Android Studio project, then fetch news articles from a static API using retrofit and Kotlin coroutines flow, and display them in a recycler view with MVVM.
Add Retrofit dependencies (Retrofit 2.6.0, Json converter, coroutines) and create a news service interface for get news, configure base url, and return a flow of articles with a delay.
Use retrofit to stream news articles as a flow, convert to live data, and update the UI by adding items to the top and auto-scrolling to newest every three seconds.
Explore channels in Kotlin coroutines, learning how to create and send data between coroutines, use channel producers, pipelines, fan-out, fan-in, buffer channels, and ticker channels, with hands-on exercises.
Explore channels as queues for asynchronous data exchange in Kotlin coroutines, using send for non-blocking puts and receive for blocking reads; close and iterate to process remaining items.
Explore creating channels with Kotlin coroutines' produce function to emit values asynchronously, such as squaring numbers, and process each value with consume.
Design pipelines by chaining channels where the output of one becomes the input of the next, transforming values like numbers produced by one channel into squares via another.
Explore the fan-out principle where multiple coroutines receive from a single channel and distribute values among themselves. Learn how processing time versus production delay determines equal distribution or nearest-available processing.
Demonstrate fan-in by having multiple coroutines send strings to a shared channel, then receive them in order as they arrive, preserving queue order.
Explore buffered channels in Kotlin coroutines to enforce a limited capacity, pause the sender when full, and resume as capacity frees, illustrated with a sender and receiver example.
Learn how a ticker channel emits a unit at a delay with optional initial delay, and consume ticks in a coroutine to measure deltas between ticks and perform processing.
Explore the shared state problem in multithreading with coroutines, and learn three solutions: atomic variables, thread confinement, and mutexes to manage parallel processing effects.
Explore how coroutines update shared state and how simultaneous updates cause race conditions, as 100 coroutines increment a counter 1000 times may yield about 50,000 instead of 100,000.
Leverage atomic variables to safely update a counter across coroutines, using an atomic integer with increment and get, showing thread-safe performance for primitive data types. Note limitations for complex types.
Explore thread confinement strategies in Kotlin coroutines, contrasting fine-grained and coarse-grained approaches with single thread context, and observe how context switching and serialization affect performance of shared state updates.
Use a mutex to guard shared state by locking around critical sections and unlocking afterward, enabling parallel coroutines while ensuring safe updates and improved performance.
Celebrate completing the course and apply knowledge of coroutines to your Android apps by running tasks in the background and updating the main thread, improving multithreaded performance.
This is the most complete resource online for learning about Kotlin coroutines.
Coroutines are the hot new topic in Kotlin development. They will impact everything you do, and make your applications multithreaded. Efficiency is the main goal, and with this course you will become an expert in designing multi threaded, parallel applications. This is the best resource you will find online to learn about Kotlin coroutines.
This course will take you step by step, through each concept related to coroutines, discuss it in detail, then apply it in a practical project in Kotlin.
We will cover topics such as:
Scope
Context
Suspending functions
Jobs
Dispatchers
async
withContext
Exception handling
Asynchronous flow
Properties
Flow cancellation
Operators
Buffering
Composing flows
Channels
Producer
Pipelines
Fan-in and fan-out
Buffered channels
Ticker channels
We will go through all these topics and explain them in detail. We will also implement many coding examples to make sure you fully understand and are able to apply the concepts.
In addition, we will also be working on several Android apps to apply the knowledge we learned.
A background image processing app
A network communications app using Coroutines, Retrofit and MVVM
A Room database using coroutines
A news ticker app using Asynchronous Flows, Retrofit and MVVM
This course is great if you want to take your multithreading and parallel processing skills to the next level.
Sign up today and let's start learning about Kotlin Coroutines.