Use coroutines in common Android use cases quiz Return to pathway What are the benefits of using coroutines? Choose as many answers as you see fit. Callback-free, sequential code Structured concurrency (e.g. run async operations in a scope) Built-in cancellation support Faster execution of background work What can call a function marked with the suspend modifier without causing a compile error? Choose as many answers as you see fit. Any Kotlin function Other suspending functions Only public functions Coroutines What is the recommended CoroutineScope to use in ViewModel to launch UI-related coroutines? mainScope viewModelScope uiScope It’s not recommended to start coroutines from the main thread. To specify where a coroutine should run, which of the following are the three predefined dispatchers you can choose from? Choose as many answers as you see fit. Dispatchers.Background Dispatchers.Default Dispatchers.IO Dispatchers.Main Dispatchers.Network Fill-in-the-blanks Enter one or more words to complete the sentence. To use coroutines with WorkManager, extend ___ and override doWork(), which is a suspending function. Fill-in-the-blanks Enter one or more words to complete the sentence. When using the Room library in your app, add the ___ keyword to your DAO methods so that they can be safely called from the main thread. For testing coroutines, which of the following statements are true about the runBlockingTest function? Choose as many answers as you see fit. It blocks until the coroutine started by runBlockingTest finishes. It's a non-blocking call. It should be used in user-facing app code. It executes any suspending functions it calls immediately. It can be a flaky test depending on how long the coroutine takes. Submit answers error_outline An error occurred when grading the quiz. Please try again.