androidx.work
Interfaces
Provider |
A class that can provide the |
ForegroundUpdater |
Manages updating |
Operation |
An object that provides information about the execution of an asynchronous command being performed by |
ProgressUpdater |
Updates progress for a |
RunnableScheduler |
Can be used to schedule |
Classes
ArrayCreatingInputMerger |
An |
Configuration |
The Configuration object used to customize |
Constraints |
A specification of the requirements that need to be met before a |
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 |
DelegatingWorkerFactory |
A |
ForegroundInfo |
The information required when a |
InputMerger |
An abstract class that allows the user to define how to merge a list of inputs to a |
InputMergerFactory |
A factory object that creates |
ListenableWorker |
A class that can perform work asynchronously in |
OneTimeWorkRequest |
A |
OverwritingInputMerger |
An |
PeriodicWorkRequest |
A |
RxWorker |
RxJava2 interoperability Worker implementation. |
WorkContinuation |
A class that allows you to chain together |
Worker |
A class that performs work synchronously on a background thread provided by |
WorkerFactory |
A factory object that creates |
WorkerParameters |
Setup parameters for a |
WorkInfo |
Information about a particular |
WorkManager |
WorkManager is a library used to enqueue deferrable work that is guaranteed to execute sometime after its |
WorkQuery |
A specification for querying |
WorkRequest |
The base class for specifying parameters for work that should be enqueued in |
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 |
ExistingWorkPolicy |
An enumeration of the conflict resolution policies available to unique |
NetworkType |
An enumeration of various network types that can be used as |
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 |
PeriodicWorkRequestBuilder(repeatInterval: Duration) 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 |
ListenableFuture<R>.await() 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 |
Data.hasKeyWithValueOfType(key: String) Returns true if the instance of Data has a value corresponding to the given key with an expected type T. |
For Builder | |
OneTimeWorkRequest.Builder |
OneTimeWorkRequest.Builder.setInputMerger(@NonNull inputMerger: KClass<out InputMerger>) Sets an InputMerger on the OneTimeWorkRequest.Builder. |
Top-level functions
OneTimeWorkRequestBuilder
inline fun <reified W : ListenableWorker> OneTimeWorkRequestBuilder(): OneTimeWorkRequest.Builder
Creates a OneTimeWorkRequest with the given ListenableWorker.
PeriodicWorkRequestBuilder
inline fun <reified W : ListenableWorker> PeriodicWorkRequestBuilder(
repeatInterval: Long,
repeatIntervalTimeUnit: TimeUnit
): PeriodicWorkRequest.Builder
Creates a PeriodicWorkRequest.Builder with a given ListenableWorker.
Parameters | |
---|---|
repeatInterval: Long | @see androidx.work.PeriodicWorkRequest.Builder |
repeatIntervalTimeUnit: TimeUnit | @see androidx.work.PeriodicWorkRequest.Builder |
PeriodicWorkRequestBuilder
@RequiresApi(26) inline fun <reified W : ListenableWorker> PeriodicWorkRequestBuilder(repeatInterval: Duration): PeriodicWorkRequest.Builder
Creates a PeriodicWorkRequest.Builder with a given ListenableWorker.
Parameters | |
---|---|
repeatInterval: Duration | @see androidx.work.PeriodicWorkRequest.Builder |
PeriodicWorkRequestBuilder
inline fun <reified W : ListenableWorker> PeriodicWorkRequestBuilder(
repeatInterval: Long,
repeatIntervalTimeUnit: TimeUnit,
flexTimeInterval: Long,
flexTimeIntervalUnit: TimeUnit
): PeriodicWorkRequest.Builder
Creates a PeriodicWorkRequest.Builder with a given ListenableWorker.
Parameters | |
---|---|
repeatInterval: Long | @see androidx.work.PeriodicWorkRequest.Builder |
repeatIntervalTimeUnit: TimeUnit | @see androidx.work.PeriodicWorkRequest.Builder |
flexTimeInterval: Long | @see androidx.work.PeriodicWorkRequest.Builder |
flexTimeIntervalUnit: TimeUnit | @see androidx.work.PeriodicWorkRequest.Builder |
PeriodicWorkRequestBuilder
@RequiresApi(26) inline fun <reified W : ListenableWorker> PeriodicWorkRequestBuilder(
repeatInterval: Duration,
flexTimeInterval: Duration
): PeriodicWorkRequest.Builder
Creates a PeriodicWorkRequest.Builder with a given ListenableWorker.
Parameters | |
---|---|
repeatInterval: Duration | @see androidx.work.PeriodicWorkRequest.Builder |
flexTimeInterval: Duration | @see androidx.work.PeriodicWorkRequest.Builder |
workDataOf
inline fun workDataOf(vararg pairs: Pair<String, Any?>): Data
Converts a list of pairs to a Data object.
If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.
Entries of the map are iterated in the order they were specified.
Extension functions
await
inline suspend fun <R> ListenableFuture<R>.await(): R
Awaits for the completion of the ListenableFuture without blocking a thread.
Return | |
---|---|
R The result from the | ListenableFuture |
await
inline suspend fun Operation.await(): Operation.State.SUCCESS
Awaits an Operation without blocking a thread.