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

Concurrent Programming with Android: Threads, Workers, and Kotlin Coroutines
Concurrent Programming with Android: Threads, Workers, and Kotlin Coroutines
English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 2h 16m | 491 MB

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.

Table of Contents

Introduction
1 Concurrency matters in Android apps
2 What you should know

Getting Started
3 Choices for concurrency in Android apps
4 Explore the starting application

Using Handlers Runnables and Threads
5 Define and run a Runnable object
6 Delay execution of a Runnable object
7 Manage background tasks with threads
8 Send a message to the UI from a background thread
9 Challenge Run multiple background tasks with threads
10 Solution Run multiple background tasks with threads

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

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

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