July 2018
Intermediate to advanced
242 pages
8h 6m
English
The first step to start working with Kotlin Coroutines is to add the core-framework dependency to the project:
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.3'
Apart from the Coroutines core dependency, we will need to add one of the framework-specific coroutines sub-modules, providing the coroutine-context implementation responsible for dispatching the coroutine on the UI thread. You can find the list of coroutines' framework sub-modules in the official guide: https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/coroutines-guide-ui.md. In this recipe, we are going to target the Android platform, however, you can easily port the sample code to one of the supported frameworks such as, Android, Swing, ...
Read now
Unlock full access