androidx.work

Classes

ArrayCreatingInputMerger

An InputMerger that attempts to merge the various inputs.

Configuration

Configuration for WorkManager.

Constraints

The constraints that can be applied to one WorkRequest.

ContentUriTriggers

Stores a set of Triggers

Data

Persistable set of key/value pairs which are passed as inputs and outputs for Workers.

InputMerger

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

OneTimeWorkRequest

A class that represents a request for non-repeating work.

OverwritingInputMerger

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

PeriodicWorkRequest

A class that represents a request for repeating work.

WorkContinuation

An opaque class that allows you to chain together OneTimeWorkRequest.

Worker

The basic unit of work.

WorkManager

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

WorkRequest

The base interface for work requests.

WorkStatus

A simple class with the id of a WorkRequest, its current State, output, and tags.

Enums

BackoffPolicy

The backoff policy to use when rescheduling work.

ExistingWorkPolicy

An enum that determines what to do with existing work with the same unique tag in case of a collision.

NetworkType

The type of network required by a unit of work.

State

The current status of a unit of work.

Top-level functions summary

OneTimeWorkRequest.Builder

Creates a OneTimeWorkRequest with the given Worker.

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

Creates a PeriodicWorkRequest.Builder with a given Worker.

PeriodicWorkRequest.Builder

Creates a PeriodicWorkRequest.Builder with a given Worker.

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

Creates a PeriodicWorkRequest.Builder with a given Worker.

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

Creates a PeriodicWorkRequest.Builder with a given Worker.

Extension functions summary

Top-level functions

OneTimeWorkRequestBuilder

inline fun <reified W : Worker> OneTimeWorkRequestBuilder(): OneTimeWorkRequest.Builder

Creates a OneTimeWorkRequest with the given Worker.

PeriodicWorkRequestBuilder

inline fun <reified W : Worker> PeriodicWorkRequestBuilder(repeatInterval: Long, repeatIntervalTimeUnit: TimeUnit): PeriodicWorkRequest.Builder

Creates a PeriodicWorkRequest.Builder with a given Worker.

Parameters
repeatInterval @see androidx.work.PeriodicWorkRequest.Builder
repeatIntervalTimeUnit @see androidx.work.PeriodicWorkRequest.Builder

PeriodicWorkRequestBuilder

inline fun <reified W : Worker> PeriodicWorkRequestBuilder(repeatInterval: Duration): PeriodicWorkRequest.Builder

Creates a PeriodicWorkRequest.Builder with a given Worker.

Parameters
repeatInterval @see androidx.work.PeriodicWorkRequest.Builder

PeriodicWorkRequestBuilder

inline fun <reified W : Worker> PeriodicWorkRequestBuilder(repeatInterval: Long, repeatIntervalTimeUnit: TimeUnit, flexTimeInterval: Long, flexTimeIntervalUnit: TimeUnit): PeriodicWorkRequest.Builder

Creates a PeriodicWorkRequest.Builder with a given Worker.

Parameters
repeatInterval @see androidx.work.PeriodicWorkRequest.Builder
repeatIntervalTimeUnit @see androidx.work.PeriodicWorkRequest.Builder
flexInterval @see androidx.work.PeriodicWorkRequest.Builder
flexIntervalTimeUnit @see androidx.work.PeriodicWorkRequest.Builder

PeriodicWorkRequestBuilder

inline fun <reified W : Worker> PeriodicWorkRequestBuilder(repeatInterval: Duration, flexTimeInterval: Duration): PeriodicWorkRequest.Builder

Creates a PeriodicWorkRequest.Builder with a given Worker.

Parameters
repeatInterval @see androidx.work.PeriodicWorkRequest.Builder
flexInterval @see androidx.work.PeriodicWorkRequest.Builder

Extension functions

setInputMerger

inline fun OneTimeWorkRequest.Builder.setInputMerger(inputMerger: KClass<out InputMerger>): OneTimeWorkRequest.Builder!

Sets an InputMerger on the OneTimeWorkRequest.Builder.

toWorkData

inline fun <V> Map<String, V>.toWorkData(): Data

Converts a Map to a Data object.