Concurrent Programming with Android: Threads, Workers, and Kotlin Coroutines
2h 16mAdvanced2020-06-09
Authors

David Gassner
Author of 60+ video-based training courses for software developers
Course details
Best practices for concurrent programming in Android have gone through major changes in the past few years. From new restrictions on the use of long-running services to the introduction of Kotlin coroutines and the WorkManager API, Android developers have many new skills to learn. In this course, instructor David Gassner takes a deep dive into concurrent programming for Android, providing a hands-on tour of different ways to run Android tasks in the background. Learn about various kinds of services: bound, started, foreground, and implementations of JobIntentService. Explore the use of Handlers, Threads, and Runnable objects to delay or push tasks into background threads. Plus, learn about the use of Kotlin coroutines to run multiple concurrent operations and manage background threads.
Skills covered
Android StudioKotlinAndroid DevelopmentAndroidMobile DevelopmentProgramming FoundationsGoogleOpen SourceSoftware DevelopmentDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Concurrency matters in Android apps
- 02 - What you should know
1. Getting Started
- 03 - Choices for concurrency in Android apps
- 04 - Explore the starting application
2. Using Handlers, Runnables, and Threads
- 05 - Define and run a Runnable object
- 06 - Delay execution of a Runnable object
- 07 - Manage background tasks with threads
- 08 - Send a message to the UI from a background thread
- 09 - Challenge - Run multiple background tasks with threads
- 10 - Solution - Run multiple background tasks with threads
3. Manage Concurrent Tasks with Kotlin Coroutines
- 11 - Define and run a simple coroutine
- 12 - Switch between foreground and background threads
- 13 - Run coroutines in a ViewModel class
- 14 - Cancel coroutines with a job reference
- 15 - Challenge - Run multiple coroutines in a ViewModel
- 16 - Solution - Run multiple coroutines in a ViewModel
4. Manage Background and Deferrable Tasks
- 17 - Run background tasks with IntentService
- 18 - Upgrade IntentService to JobIntentService
- 19 - Send results from JobIntentService to the UI
- 20 - Manage deferrable tasks with WorkManager
- 21 - Set work request constraints
- 22 - Get results from a background worker
- 23 - Send progress updates from a background worker
5. Create and Manage Long-Running Services
- 24 - Create and run a bound service
- 25 - Started services and background processing limits
- 26 - Play audio in a service with MediaPlayer
- 27 - Run a service in the foreground
- 28 - Send intents from a foreground notification
- 29 - Style a foreground notification
Conclusion
- 30 - Next steps
Related courses
- Exploring Ktor with Kotlin Multiplatform and Compose
- Android Development: Retrofit with Kotlin
- Parallel and Concurrent Programming with Java 1
- Parallel and Concurrent Programming with C++ Part 1
- Parallel and Concurrent Programming with Java 2
- Complete Guide to Parallel and Concurrent Programming with Java
- Complete Guide to Parallel and Concurrent Programming with C++
- Parallel and Concurrent Programming with C++ Part 2
Related learn paths
- Prepare for the Google Associate Android Developer Certification
- Advance Your Skills in C++
- Master C++
- Getting Started as a C# Developer
- C# Foundations: From Basics to Building Blocks
- Advance your Node.js Skills
- Advancing Your Azure Developer Skills: Exploring Complex Application Development
- Develop Your Rust Skills for Data Engineering