Android 12 Developer Preview is here! Try it out, and give us your feedback!

androidx.work

Interfaces

Provider

A class that can provide the Configuration for WorkManager and allow for on-demand initialization of WorkManager.

ForegroundUpdater

Manages updating android.app.Notifications when a ListenableWorker transitions to running in the context of a foreground android.app.Service.

Operation

An object that provides information about the execution of an asynchronous command being performed by WorkManager.

ProgressUpdater

Updates progress for a androidx.work.ListenableWorker.

RunnableScheduler

Can be used to schedule Runnables after a delay in milliseconds.

Classes

ArrayCreatingInputMerger

An InputMerger that attempts to merge the inputs, creating arrays when necessary.

Configuration

The Configuration object used to customize WorkManager upon initialization.

Constraints

A specification of the requirements that need to be met before a WorkRequest can run.

CoroutineWorker

A ListenableWorker implementation that provides interop with Kotlin Coroutines.

Data

A persistable set of key/value pairs which are used as inputs and outputs for ListenableWorkers.

DelegatingWorkerFactory

A WorkerFactory which delegates to other factories.

ForegroundInfo

The information required when a ListenableWorker runs in the context of a foreground service.

InputMerger

An abstract class that allows the user to define how to merge a list of inputs to a ListenableWorker.

InputMergerFactory

A factory object that creates InputMerger instances.

ListenableWorker

A class that can perform work asynchronously in WorkManager.

OneTimeWorkRequest

A WorkRequest for non-repeating work.

OverwritingInputMerger

An InputMerger that attempts to add all keys from all inputs to the output.

PeriodicWorkRequest

A WorkRequest for repeating work.

RxWorker

RxJava2 interoperability Worker implementation.

WorkContinuation

A class that allows you to chain together OneTimeWorkRequests.

Worker

A class that performs work synchronously on a background thread provided by WorkManager.

WorkerFactory

A factory object that creates ListenableWorker instances.

WorkerParameters

Setup parameters for a ListenableWorker.

WorkInfo

Information about a particular WorkRequest containing the id of the WorkRequest, its current State, output, tags, and run attempt count.

WorkManager

WorkManager is a library used to enqueue deferrable work that is guaranteed to execute sometime after its Constraints are met.

WorkQuery

A specification for querying WorkRequests.

WorkRequest

The base class for specifying parameters for work that should be enqueued in WorkManager.

Annotations

ExperimentalExpeditedWork

An API surface for expedited WorkRequests.

Enums

BackoffPolicy

An enumeration of backoff policies when retrying work.

DirectExecutor

A simple Executor.

ExistingPeriodicWorkPolicy

An enumeration of the conflict resolution policies available to unique PeriodicWorkRequests in case of a collision.

ExistingWorkPolicy

An enumeration of the conflict resolution policies available to unique OneTimeWorkRequests in case of a collision.

NetworkType

An enumeration of various network types that can be used as Constraints for work.

OutOfQuotaPolicy

An enumeration of policies that help determine out of quota behavior for expedited jobs.

Top-level functions summary

OneTimeWorkRequest.Builder

Creates a OneTimeWorkRequest with the given ListenableWorker.

PeriodicWorkRequest.Builder
PeriodicWorkRequestBuilder(repeatInterval: Long, repeatIntervalTimeUnit: TimeUnit)

Creates a PeriodicWorkRequest.Builder with a given ListenableWorker.

PeriodicWorkRequest.Builder

Creates a PeriodicWorkRequest.Builder with a given ListenableWorker.

PeriodicWorkRequest.Builder
PeriodicWorkRequestBuilder(repeatInterval: Long, repeatIntervalTimeUnit: TimeUnit, flexTimeInterval: Long, flexTimeIntervalUnit: TimeUnit)

Creates a PeriodicWorkRequest.Builder with a given ListenableWorker.

PeriodicWorkRequest.Builder
PeriodicWorkRequestBuilder(repeatInterval: Duration, flexTimeInterval: Duration)

Creates a PeriodicWorkRequest.Builder with a given ListenableWorker.

Data
workDataOf(vararg pairs: Pair<String, Any?>)

Converts a list of pairs to a Data object.

Extension functions summary

For com.google.common.util.concurrent.ListenableFuture
suspend R

Awaits for the completion of the ListenableFuture without blocking a thread.

For Operation
suspend Operation.State.SUCCESS

Awaits an Operation without blocking a thread.

For Data
Boolean

Returns true if the instance of Data has a value corresponding to the given key with an expected type T.

For Builder
OneTimeWorkRequest.Builder<