# CameraXConfig

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/CameraXConfig.java+class:androidx.camera.core.CameraXConfig) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

*** ** * ** ***


```
class CameraXConfig
```

<br />

*** ** * ** ***

A configuration for adding implementation and user-specific behavior to CameraX.

CameraXConfig provides customizable options for camera provider instances that persist for the lifetime of the provider.

An implementation of CameraXConfig can be provided by subclassing the `https://developer.android.com/reference/android/app/Application.html` object and implementing `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Provider`. Alternatively, other methods configuration exist such as `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider#configureInstance(androidx.camera.core.CameraXConfig)`. `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider#getInstance(android.content.Context)` of how this is used can be found in the `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/package-summary` package.

Applications can create and use `https://developer.android.com/reference/kotlin/androidx/camera/camera2/Camera2Config` of CameraXConfig provided in `https://developer.android.com/reference/kotlin/androidx/camera/camera2/package-summary`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider#configureInstance(androidx.camera.core.CameraXConfig)` |   |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder` |   |

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder` A builder for generating `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig` objects. |
| `interface https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Provider` An interface which can be implemented to provide the configuration for CameraX. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraSelector?` | `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig#getAvailableCamerasLimiter(androidx.camera.core.CameraSelector)(valueIfMissing: https://developer.android.com/reference/kotlin/androidx/camera/core/CameraSelector?)` Returns the `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraSelector` used to determine the available cameras. |
| `https://developer.android.com/reference/java/util/concurrent/Executor.html?` | `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig#getCameraExecutor(java.util.concurrent.Executor)(valueIfMissing: https://developer.android.com/reference/java/util/concurrent/Executor.html?)` Returns the camera executor which CameraX will use to drive the camera stack. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig#getCameraOpenRetryMaxTimeoutInMillisWhileResuming()()` Returns the camera open retry maximum timeout in milliseconds when in active resuming mode. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy` | `@https://developer.android.com/reference/kotlin/androidx/camera/core/ExperimentalRetryPolicy https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig#getCameraProviderInitRetryPolicy()()` Retrieves the `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy` for the CameraProvider initialization. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig#getMinimumLoggingLevel()()` Returns the minimum logging level to be used for CameraX logs. |
| `https://developer.android.com/reference/android/os/Handler.html?` | `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig#getSchedulerHandler(android.os.Handler)(valueIfMissing: https://developer.android.com/reference/android/os/Handler.html?)` Returns the scheduling handler that CameraX will use internally for scheduling future tasks. |

## Public functions

### getAvailableCamerasLimiter

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun getAvailableCamerasLimiter(valueIfMissing: CameraSelector?): CameraSelector?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraSelector` used to determine the available cameras.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder#setAvailableCamerasLimiter(androidx.camera.core.CameraSelector)` |   |

### getCameraExecutor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun getCameraExecutor(valueIfMissing: Executor?): Executor?
```

Returns the camera executor which CameraX will use to drive the camera stack.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder#setCameraExecutor(java.util.concurrent.Executor)` |   |

### getCameraOpenRetryMaxTimeoutInMillisWhileResuming

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
fun getCameraOpenRetryMaxTimeoutInMillisWhileResuming(): Long
```

Returns the camera open retry maximum timeout in milliseconds when in active resuming mode.

If this value is not set, -1L will be returned by default.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder#setCameraOpenRetryMaxTimeoutInMillisWhileResuming(long)` |   |

### getCameraProviderInitRetryPolicy

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/camera#1.4.0)

```
@ExperimentalRetryPolicy
fun getCameraProviderInitRetryPolicy(): RetryPolicy
```

Retrieves the `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy` for the CameraProvider initialization. This policy determines whether to retry the CameraProvider initialization if it fails.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy` | The `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy` to be used for the CameraProvider initialization. If not explicitly set, it defaults to `https://developer.android.com/reference/kotlin/androidx/camera/core/RetryPolicy#DEFAULT()`. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder#setCameraProviderInitRetryPolicy(androidx.camera.core.RetryPolicy)` |   |

### getMinimumLoggingLevel

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/camera#1.0.0)

```
fun getMinimumLoggingLevel(): Int
```

Returns the minimum logging level to be used for CameraX logs.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder#setMinimumLoggingLevel(int)` |   |

### getSchedulerHandler

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/camera#1.1.0)

```
fun getSchedulerHandler(valueIfMissing: Handler?): Handler?
```

Returns the scheduling handler that CameraX will use internally for scheduling future tasks.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraXConfig.Builder#setSchedulerHandler(android.os.Handler)` |   |