What is the difference between launch/join and async/await in Kotlin coroutines

launch is used to fire and forget coroutine. It is like starting a new thread. If the code inside the launch terminates with exception, then it is treated like uncaught exception in a thread — usually printed to stderr in backend JVM applications and crashes Android applications. join is used to wait for completion of … Read more

What does the suspend function mean in a Kotlin Coroutine?

Suspending functions are at the center of everything coroutines. A suspending function is simply a function that can be paused and resumed at a later time. They can execute a long running operation and wait for it to complete without blocking. The syntax of a suspending function is similar to that of a regular function … Read more

How to make “inappropriate blocking method call” appropriate?

The warning is about methods that block current thread and coroutine cannot be properly suspended. This way, you lose all benefits of coroutines and downgrade to one job per thread again. Each case should be handled in a different way. For suspendable http calls you can use ktor http client. But sometimes there is no … Read more

tech