# androidx.camera.lifecycle

*** ** * ** ***

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/LifecycleCameraProvider` | Provides access to a camera which has its opening and closing controlled by a `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner`. |

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider` | A singleton which can be used to bind the lifecycle of cameras to any `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner` within an application's process. |

## Objects

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider.Companion` |   |

## Annotations

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ExperimentalCameraProviderConfiguration` | Denotes that the annotated method uses an experimental path for configuring a camera provider. |

## Extension functions summary

|---|---|
| `suspend https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider` | `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider.Companion.https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/package-summary#(androidx.camera.lifecycle.ProcessCameraProvider.Companion).awaitInstance(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` Retrieves the `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider`. |

## Extension functions

### ProcessCameraProvider.Companion.awaitInstance

Artifact: [androidx.camera:camera-lifecycle](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/lifecycle/ProcessCameraProviderExt.kt+function:awaitInstance)

```
suspend fun ProcessCameraProvider.Companion.awaitInstance(context: Context): ProcessCameraProvider
```

Retrieves the `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider`.

This is a suspending function unlike `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider#getInstance(android.content.Context)` which returns a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | The application context. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider` | A fully initialized ProcessCameraProvider for the current process. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/InitializationException` | If failed to retrieve the ProcessCameraProvider, use `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/cause.html` to get the error cause. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/lifecycle/ProcessCameraProvider#getInstance(android.content.Context)` |   |