

Kotlin Coroutines – Use Cases on Android
source link: https://www.lukaslechner.com/kotlin-coroutines-use-cases-on-android/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.


For the last couple of weeks, I worked really hard on a new open-source project called Kotlin Coroutines – Use Cases on Android. Today, I am really proud to present “Version 1.0” to you!
It currently consists of 16 self-contained implementations of common real-world use cases for using Coroutines on Android. These use cases are all about performing network requests sequentially and concurrently, using timeouts, performing retries, using Coroutines together with Room and WorkManager and performing expensive processing on background threads. It also has examples for “Cooperative Cancellation” and Exception Handling. You can find more information on the project readme. It also includes unit tests, of course .

Motivation 
This is the project I wish I had when I started to learn Coroutines. It is easy to use (no setup like e.g. inserting API keys needed; just clone and run it) and easy to understand (simple architecture, self-contained implementations). If you are new to Coroutines, it will show you how to implement common Android use cases with Coroutines. You will learn them in an efficient and fun way.
But even if you already have experience with Coroutines, this repository can be a helpful companion for you. So whenever you face a tricky multithreading problem, this project is here to help you by either showing you examples similar to your problem or giving you a solid playground where you can try out your coroutine related logic very quickly.
Outlook 
I also want to add use cases for the usage of Kotlin Coroutine – Channels and Flow in the future. Star the project or sign up to my newsletter in order to get information about major updates in the future.
No Spam! Unsubscribe at any time!
Leave this field empty if you're human:
Feedback
If you have ideas for additional use cases or improvements, feel free to leave a comment or submit an issue or pull request!
I hope this project is helpful to you! Thanks for reading!
Lukas Lechner
I'm a Freelance Android Developer and Online Course Creator. I have many years of professional experience as an Android Developer and worked on some of the biggest mobile apps projects here in Austria. I like to write articles for my blog and speak at meetups and conferences.
Recommend
-
180
This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.
-
51
0.82019.10.24 02:08:33字数 647阅读 829 一. 尽量少用 GlobalScope GlobalScope 是 CoroutineScope 的实现类。我们以前使用过的 launch、async 函数都是 CoroutineScope 的扩展函数。 G...
-
12
Kotlin Coroutines Tutorial for Android – Start using Coroutines in Your AppAre you aware with Asynchronous Programming? Well if you are into android application development, I am pretty sure that you know about Asynchronous P...
-
15
How to run an expensive calculation with Kotlin Coroutines on the Android Main Thread without freezing the UI
-
9
Android Code-Along: Kotlin coroutines23,535 views•Streamed live on Mar 10, 202190216ShareSave
-
9
Use Kotlin coroutines with lifecycle-aware components Kotlin coroutines provide an API that enables you to write asynchronous code. W...
-
13
Testing Kotlin coroutines on Android Unit testing code that uses coroutines requires some extra attention, as their execut...
-
10
-
9
Best Practices for using Kotlin Coroutines in Android Development ...
-
12
My Coroutines Course just got a BIG update: Kotlin Flow for Android Development Hi Readers There hasn’t...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK