The Android Developer Challenge is back! Submit your idea before December 2.

Configuration

class Configuration
kotlin.Any
   ↳ androidx.work.Configuration

The Configuration object used to customize WorkManager upon initialization. Configuration contains various parameters used to setup WorkManager. For example, it is possible to customize the Executor used by Workers here.

To set a custom Configuration for WorkManager, see WorkManager#initialize(Context, Configuration).

Summary

Nested classes

A Builder for Configurations.

abstract

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

Constants

static Int

The minimum number of system requests which can be enqueued by WorkManager when using android.app.job.JobScheduler or android.app.AlarmManager.

Public methods

Executor

Gets the Executor used by WorkManager to execute Workers.

InputMergerFactory

Int

Gets the last valid id when scheduling work with android.app.job.JobScheduler.

Int

Gets the first valid id used when scheduling work with android.app.job.JobScheduler.

Executor

Gets the Executor used by WorkManager for all its internal business logic.

WorkerFactory

Gets the WorkerFactory used by WorkManager to create ListenableWorkers.

Constants

MIN_SCHEDULER_LIMIT

static val MIN_SCHEDULER_LIMIT: Int

The minimum number of system requests which can be enqueued by WorkManager when using android.app.job.JobScheduler or android.app.AlarmManager.

Value: 20

Public methods

getExecutor

@NonNull fun getExecutor(): Executor

Gets the Executor used by WorkManager to execute Workers.

Return
Executor: The Executor used by WorkManager to execute Workers

getInputMergerFactory

@NonNull fun getInputMergerFactory(): InputMergerFactory
Return
InputMergerFactory: The InputMergerFactory used by WorkManager to create instances of InputMergers.

getMaxJobSchedulerId

fun getMaxJobSchedulerId(): Int

Gets the last valid id when scheduling work with android.app.job.JobScheduler.

Return
Int: The last valid id (inclusive) used by WorkManager when creating new instances of android.app.job.JobInfos. If the current jobId goes beyond the bounds of the defined range of (Configuration.Builder#getMinJobSchedulerId(), Configuration.Builder#getMaxJobSchedulerId()), it is reset to (Configuration.Builder#getMinJobSchedulerId()).

getMinJobSchedulerId

fun getMinJobSchedulerId(): Int

Gets the first valid id used when scheduling work with android.app.job.JobScheduler.

Return
Int: The first valid id (inclusive) used by WorkManager when creating new instances of android.app.job.JobInfos. If the current jobId goes beyond the bounds of the defined range of (Configuration.Builder#getMinJobSchedulerId(), Configuration.Builder#getMaxJobSchedulerId()), it is reset to (Configuration.Builder#getMinJobSchedulerId()).

getTaskExecutor

@NonNull fun getTaskExecutor(): Executor

Gets the Executor used by WorkManager for all its internal business logic.

Return
Executor: The Executor used by WorkManager for all its internal business logic

getWorkerFactory

@NonNull fun getWorkerFactory(): WorkerFactory

Gets the WorkerFactory used by WorkManager to create ListenableWorkers.

Return
WorkerFactory: The WorkerFactory used by WorkManager to create ListenableWorkers