Войти
  • 3806Просмотров
  • 3 года назадОпубликованоLukas Lechner - Advanced Android Development

Best Practices for using Kotlin Coroutines in Android Development

🎓 Get the full 15+ hour-long Course "Kotlin Coroutines and Flow for Android Development" with a nice discount here: In this video, I am going to show you 6 of the most important Best practices when using Kotlin Coroutines in your Android Applications. By following these Best Practices, you will greatly improve your Coroutine-based code. Official Best Practices Article: 👨‍🎓 Learn Coroutines and Flow with my Github Example Repository: TimeStamps: 00:00 - Intro 01:01 - Best Practice 1 - Inject Dispatchers to enable testing 05:18 - Best Practice 2 - Suspend functions should be safe to call from the main thread 07:10 - Best Practice 3 - ViewModels should create Coroutines instead of exposing suspend functions to perform business logic 10:07 - Best Practice 4 - The data and business logic should expose Suspend Functions or Flows 14:31 - Best Practice 5 - Avoid GlobalScope 17:18 - Best Practice - Make Coroutines cancellable 20:33 - Get the Full Course "Mastering Kotlin Coroutines for Android Development" ➤ Subscribe to the channel: 🌎 Check out my website: 📬 Subscribe to my newsletter: ➤ Follow me on twitter: