Summary

This chapter has introduced many new topics that are going to be needed for the upcoming, more advanced topics. Let's review the chapter once more to refresh our memory:

  • We started by doing some Android programming, creating a RecyclerView and displaying the news from the RSS feeds.
  • We talked about how an Adapter maps a set of data into views, and how a ViewHolder is used as part of that.
  • We learned that Android's RecyclerView will avoid creating views as much as possible; instead, it will recycle them as the user scrolls.
  • We talked about suspending functions, and learned that they offer a flexible way to define suspending code.
  • We mentioned that async functions – a function returning an implementation of Job – should never be part of a public API, to avoid the risk of forcing a certain implementation.
  • We covered the interesting topic of the coroutine context and how it works.
  • We listed many different types of coroutine contexts, starting with dispatchers and moving on to exception handlers and the unique non-cancellable context.
  • We learned how to mix many contexts into one to get the expected behavior in our coroutines.
  • We discussed the details of separating a combined context by removing the key of one of its elements.
  • We covered the interesting withContext(), a suspend function that allows us to switch to a different context, without having to involve Job in the process.

In the next chapter, we will dive into more advanced topics. We will talk about generators, covering both iterators and sequences, and we will use them to create a potentially infinite data source that is loaded on demand.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.69.163