LiveData with Coroutines and Flow (Android Dev Summit '19)



LiveData is a simple lifecycle-aware observable, designed for making UIs that react to changes safely and efficiently. It can be used beyond View↔️ViewModel communications and even components like Room support it. However, there’s a risk of overuse, especially when dealing with multiple threads. The solution? Instead of expanding its features, LiveData now works seamlessly with Kotlin’s coroutines. In this talk, we cover the new “”liveData”” coroutine builder, showing when and how to use…

21 Comments

  1. Congrats to Yigit and Jose for a nice session!

    Just a bit silly that we have naming discrepancy in that we have lifecycleScope and viewModelScope but liveData {} is missing Scope suffix :/

    And Jose, well done for lingering in the YouTube comments…

  2. I still having problem with testing my viewmodel that launches viewmodel corotuine scope and update livedata value inside that scope.

  3. Flow APIs are very similar to Rx, what is next? adding library with extensions to clone all Rx functionality?

Leave a Reply

Your email address will not be published. Required fields are marked *