Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Provider Logo

Concurrent Programming with Android: Threads, Workers, and Kotlin Coroutines

via LinkedIn Learning

Overview

Take a deep dive into concurrent programming for Android. Learn about the techniques and components available for running tasks in the background.

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.

Syllabus

Introduction
  • Concurrency matters in Android apps
  • What you should know
1. Getting Started
  • Choices for concurrency in Android apps
  • Explore the starting application
2. Using Handlers, Runnables, and Threads
  • Define and run a Runnable object
  • Delay execution of a Runnable object
  • Manage background tasks with threads
  • Send a message to the UI from a background thread
  • Challenge: Run multiple background tasks with threads
  • Solution: Run multiple background tasks with threads
3. Manage Concurrent Tasks with Kotlin Coroutines
  • Define and run a simple coroutine
  • Switch between foreground and background threads
  • Run coroutines in a ViewModel class
  • Cancel coroutines with a job reference
  • Challenge: Run multiple coroutines in a ViewModel
  • Solution: Run multiple coroutines in a ViewModel
4. Manage Background and Deferrable Tasks
  • Run background tasks with IntentService
  • Upgrade IntentService to JobIntentService
  • Send results from JobIntentService to the UI
  • Manage deferrable tasks with WorkManager
  • Set work request constraints
  • Get results from a background worker
  • Send progress updates from a background worker
5. Create and Manage Long-Running Services
  • Create and run a bound service
  • Started services and background processing limits
  • Play audio in a service with MediaPlayer
  • Run a service in the foreground
  • Send intents from a foreground notification
  • Style a foreground notification
Conclusion
  • Next steps

Taught by

David Gassner

Related Courses

Reviews

0.0 rating, based on 0 reviews

Start your review of Concurrent Programming with Android: Threads, Workers, and Kotlin Coroutines

Never stop learning Never Stop Learning!

Get personalized course recommendations, track subjects and courses with reminders, and more.

Sign up for free