# androidx.web

*** ** * ** ***

Web is a collection of modern APIs that can be used with `android.webkit`, `androidx.webkit`, and `androidx.web.compose`.

This package provides components to manage `https://developer.android.com/reference/android/webkit/WebView.html` state independently of the view hierarchy, allowing `https://developer.android.com/reference/android/webkit/WebView.html` state to outlive configuration changes.

Key components include:

- `https://developer.android.com/reference/kotlin/androidx/web/WebContent`: Persistent web engine session state that can safely outlive individual UI views or `https://developer.android.com/reference/android/app/Activity.html`.

- `https://developer.android.com/reference/kotlin/androidx/web/WebContentView`: Specialized `https://developer.android.com/reference/android/webkit/WebView.html` designed to integrate with `https://developer.android.com/reference/kotlin/androidx/web/WebContent`.

- `https://developer.android.com/reference/kotlin/androidx/web/DetachedWebContentView`: Specialized `https://developer.android.com/reference/kotlin/androidx/web/WebContentView` that `https://developer.android.com/reference/kotlin/androidx/web/WebContent` attaches to when not attached to an `https://developer.android.com/reference/android/app/Activity.html`.

- `https://developer.android.com/reference/kotlin/androidx/web/WebFeature`: Utility for checking the runtime availability of newer Web APIs.

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/web/DetachedWebContentView` | A specialized `https://developer.android.com/reference/kotlin/androidx/web/WebContentView` that represents a `https://developer.android.com/reference/kotlin/androidx/web/WebContent` session which has been temporarily detached from the view hierarchy. |
| `https://developer.android.com/reference/kotlin/androidx/web/WebContent` | `https://developer.android.com/reference/kotlin/androidx/web/WebContent` can `https://developer.android.com/reference/kotlin/androidx/web/WebContent#attach(android.content.Context,java.util.function.Function)` and `https://developer.android.com/reference/kotlin/androidx/web/WebContentView`s to outlive `https://developer.android.com/reference/android/app/Activity.html` lifetimes. |
| `https://developer.android.com/reference/kotlin/androidx/web/WebContent.Builder` | Builder for `https://developer.android.com/reference/kotlin/androidx/web/WebContent`. |
| `https://developer.android.com/reference/kotlin/androidx/web/WebContentView` | This is a `https://developer.android.com/reference/android/webkit/WebView.html` that is created via `https://developer.android.com/reference/kotlin/androidx/web/WebContent`. |

## Objects

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/web/WebFeature` | Utility class for checking which Web features are supported on the device. |

## Top-level functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/web/WebContent` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresFeature(name = "WEB_CONTENT", enforcement = "androidx.web.WebFeature#isFeatureSupported") https://developer.android.com/reference/kotlin/androidx/web/package-summary#WebContent(kotlin.Function1)(block: https://developer.android.com/reference/kotlin/androidx/web/WebContent.Builder.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Creates and configures a `https://developer.android.com/reference/kotlin/androidx/web/package-summary#WebContent(kotlin.Function1)` instance. |

## Top-level functions

### WebContent

Artifact: [androidx.web:web](https://developer.android.com/jetpack/androidx/releases/web) [View Source](https://cs.android.com/search?q=file:androidx/web/WebContent.kt+function:WebContent)

```
@RequiresFeature(name = "WEB_CONTENT", enforcement = "androidx.web.WebFeature#isFeatureSupported")
fun WebContent(block: WebContent.Builder.() -> Unit = {}): WebContent
```

Creates and configures a `https://developer.android.com/reference/kotlin/androidx/web/package-summary#WebContent(kotlin.Function1)` instance.