All about Coroutines…
<p>Hello people, we are back with one more article and I know you’ve read the title already. In this article I’ll try to cover all the important questions related to coroutine. So without wasting any time, let’s dive in.</p>
<h1>What are Coroutines?</h1>
<p>Coroutines are a design pattern for writing asynchronous program in android which is helpful for running multiple tasks concurrently.</p>
<h1>How are Coroutines different from threads?</h1>
<p>Following are the difference between coroutines and threads.</p>
<ol>
<li>Threads are not lifecycle aware <em>i.e.</em> they are not aware of activity, fragment or view model where as coroutines are life cycle aware and can be launched through <em>GlobalScope</em>, <em>lifeCycleScope</em> or <em>viewModelScope</em>.</li>
</ol>
<p><a href="https://medium.com/@saurav_suman/all-about-coroutines-b24f3fb9d7f0"><strong>Click Here</strong></a></p>