Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/content/pm/webapp/WebAppManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/pm/webapp/WebAppManager#inhmethods)

# WebAppManager

*** ** * ** ***

` public final class WebAppManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.pm.webapp.WebAppManager |

<br />

*** ** * ** ***

System service that manages the installation and querying of Web Apps.

This class acts as the entry point for managing Web Apps installed as Android apps.

To obtain an instance of this manager, use `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)`:

    WebAppManager webAppManager = context.getSystemService(WebAppManager.class);

<br />

**See also:**

- `https://developer.android.com/reference/android/content/pm/webapp/WebAppInstallRequest`
- `https://developer.android.com/reference/android/content/pm/webapp/WebAppQueryRequest`

## Summary

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/content/pm/webapp/WebAppManager#install(android.content.pm.webapp.WebAppInstallRequest,%20java.util.concurrent.Executor,%20java.util.function.ObjIntConsumer<java.lang.String>)(https://developer.android.com/reference/android/content/pm/webapp/WebAppInstallRequest request, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/ObjIntConsumer<https://developer.android.com/reference/java/lang/String> callback) ` Requests the installation of a Web App. |
| ` boolean` | ` https://developer.android.com/reference/android/content/pm/webapp/WebAppManager#isAvailable()() ` Checks if the Web App service is available. |
| ` void` | ` https://developer.android.com/reference/android/content/pm/webapp/WebAppManager#query(android.content.pm.webapp.WebAppQueryRequest,%20java.util.concurrent.Executor,%20java.util.function.IntConsumer)(https://developer.android.com/reference/android/content/pm/webapp/WebAppQueryRequest request, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/IntConsumer callback) ` Queries the status of a specific Web App package. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### install

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void install (WebAppInstallRequest request, 
                Executor executor, 
                ObjIntConsumer<String> callback)
```

Requests the installation of a Web App.

This operation is asynchronous. The request is processed by the system in the background, and the result is delivered via the provided callback.

<br />

| Parameters ||
|---|---|
| `request` | `WebAppInstallRequest`: The `https://developer.android.com/reference/android/content/pm/webapp/WebAppInstallRequest` containing the app details (such as title and manifest URL). This value cannot be `null`. <br /> |
| `executor` | `Executor`: The `https://developer.android.com/reference/java/util/concurrent/Executor` on which the callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `ObjIntConsumer`: The callback to receive the installation result. The `https://developer.android.com/reference/java/lang/String` is the package name of the installed web app. The int value is one of the result codes defined in `https://developer.android.com/reference/android/content/pm/webapp/WebAppInstallRequest`. The `https://developer.android.com/reference/java/lang/String` will be `null` if the result code is not `https://developer.android.com/reference/android/content/pm/webapp/WebAppInstallRequest#RESULT_SUCCESS`. <br /> |

### isAvailable

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAvailable ()
```

Checks if the Web App service is available.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the service is available, `false` otherwise. <br /> |

### query

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void query (WebAppQueryRequest request, 
                Executor executor, 
                IntConsumer callback)
```

Queries the status of a specific Web App package.

This operation is asynchronous. The system checks if the package is installed by the Web App service and visible to the caller, delivering the result via the provided callback.

<br />

| Parameters ||
|---|---|
| `request` | `WebAppQueryRequest`: The `https://developer.android.com/reference/android/content/pm/webapp/WebAppQueryRequest` containing the package name. This value cannot be `null`. <br /> |
| `executor` | `Executor`: The `https://developer.android.com/reference/java/util/concurrent/Executor` on which the callback will be invoked. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `IntConsumer`: The callback to receive the query result. The int value is one of the result codes defined in `https://developer.android.com/reference/android/content/pm/webapp/WebAppQueryRequest`. This value cannot be `null`. <br /> |