Android applications should use background tasks when appropriate, and avoid doing everything on the app's main thread. In order to make the app both responsive for your users as well as a good citizen on the Android platform, take any blocking or long-running tasks off the main (UI) thread, and run them in the background instead. This includes tasks like decoding a bitmap, accessing storage, working on a machine learning (ML) model, or performing network requests.
Things to understand about background work include:
Understand Asynchronous work. This document explains asynchronous work, and helps you understand the difference between asynchronous and persistent work.
Persistent work is background work that remains scheduled through app restarts and system reboots.
Effective use of broadcasts. Much like the publish-subscribe design pattern, Android apps can send or receive broadcast messages from the Android system and other Android apps.
How to use the different techniques necessary to test asynchronous work versus testing persistent work.
Videos
Your First Health Connect Integrated App
Updated February 27, 2025
Learn Android XR Fundamentals: Part 1 - Modes and Spatial Panels
Updated February 14, 2025
Android Basics with Compose
Updated January 14, 2025
Add Gemini capabilities to your Android app
Updated January 13, 2025
Engage Wear OS users in new ways with the Ongoing Activity API
Updated January 9, 2025
Use SQL to read and write to a database
Updated January 9, 2025
Build a Fast Checkout Experience on Android with Google Pay
Updated December 20, 2024
(Deprecated) Build a musical game using Oboe
Updated December 11, 2024
(Deprecated) Automated Accessibility Testing using Espresso
Updated December 11, 2024
(Deprecated) Advanced Android in Kotlin 05.3: Testing Coroutines and Jetpack integrations
Updated December 11, 2024
(Deprecated) Advanced Android in Kotlin 05.2: Introduction to Test Doubles and Dependency Injection
Updated December 11, 2024
(Deprecated) Advanced Android in Kotlin 05.1: Testing Basics
Updated December 11, 2024
(Deprecated) On Demand Modules
Updated December 11, 2024
(Deprecated) Tweakr: Wizard of Oz Prototyping and Remote Control with Firebase + Android
Updated December 11, 2024
(Deprecated) People: Conversations and Bubbles
Updated December 11, 2024
(Deprecated) Direct Share to an Android app
Updated December 11, 2024
(Deprecated) Two-way communication without internet
Updated December 11, 2024
(Deprecated) Create different versions of your app using build variants
Updated December 10, 2024
(Deprecated) Migrating your Dagger app to Hilt
Updated December 10, 2024
(Deprecated) Learn Jetpack Navigation
Updated December 10, 2024
(Deprecated) Using Dagger in your Android app - Kotlin
Updated December 10, 2024
(Deprecated) Data Binding in Android
Updated December 10, 2024
(Deprecated) Learn advanced coroutines with Kotlin Flow and LiveData
Updated December 10, 2024
(Deprecated) Using Hilt in your Android app
Updated December 10, 2024
(Deprecated) Use Kotlin Coroutines in your Android App
Updated December 10, 2024
(Deprecated) Building a Data Layer
Updated December 10, 2024
Jetpack Compose Navigation
Updated December 10, 2024
(Deprecated) Use ConstraintLayout to design your Android views
Updated December 9, 2024
(Deprecated) Android Paging Basics
Updated December 9, 2024
(Deprecated) Kotlin Bootcamp for programmers: Welcome to the course
Updated December 9, 2024