# RemoteActivityHelper

Artifact: [androidx.wear:wear-remote-interactions](https://developer.android.com/jetpack/androidx/releases/wear) [View Source](https://cs.android.com/search?q=file:androidx/wear/remote/interactions/RemoteActivityHelper.kt+class:androidx.wear.remote.interactions.RemoteActivityHelper) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

*** ** * ** ***


```
public final class RemoteActivityHelper
```

<br />

*** ** * ** ***

Support for opening android intents on other devices.

The following example opens play store for the given app on another device:

```
val remoteActivityHelper = RemoteActivityHelper(context, executor)

val result = remoteActivityHelper.startRemoteActivity(
    Intent(Intent.ACTION_VIEW)
        .setData(
            Uri.parse("http://play.google.com/store/apps/details?id=com.example.myapp"))
        .addCategory(Intent.CATEGORY_BROWSABLE),
    nodeId)
```

`https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)` returns a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html`, which is completed after the intent has been sent or failed if there was an issue with sending the intent.

nodeId is the opaque string that represents a [node](https://developers.google.com/android/reference/com/google/android/gms/wearable/Node) in the Android Wear network. For the given device, it can obtained by `NodeClient.getLocalNode()` and the list of nodes to which this device is currently connected can be obtained by `NodeClient.getConnectedNodes()`. More information about this can be found [here](https://developers.google.com/android/reference/com/google/android/gms/wearable/NodeClient).

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper.RemoteIntentException extends https://developer.android.com/reference/java/lang/Exception.html` |

| ### Constants |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#ACTION_REMOTE_INTENT()` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE()` Permission required to use `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startPhoneActivityWithUnlock(kotlin.String,kotlin.String,kotlin.String,android.net.Uri,kotlin.collections.List)`. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#RESULT_FAILED() = 1` Result code passed to `https://developer.android.com/reference/android/os/ResultReceiver.html#send(int, android.os.Bundle)` when a remote intent failed to send. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#RESULT_OK() = 0` Result code passed to `https://developer.android.com/reference/android/os/ResultReceiver.html#send(int, android.os.Bundle)` when a remote intent was sent successfully. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_AVAILABLE() = 3` Indicates that remote activity is available. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_TEMPORARILY_UNAVAILABLE() = 2` Indicates that remote activity is temporarily unavailable. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_UNAVAILABLE() = 1` The remote auth's availability is unknown. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_UNKNOWN() = 0` The remote activity's availability is unknown. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#RemoteActivityHelper(android.content.Context,java.util.concurrent.Executor)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor)` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#getAvailabilityStatus()()` Status of whether `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper` can `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)`, if known. |
| `static final https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#getTargetIntent(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` Returns the `https://developer.android.com/reference/android/content/Intent.html` extra specifying remote intent. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#getTargetNodeId(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` extra specifying node ID of remote intent. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 37) @https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "com.google.wear.permission.SEND_CONTINUE_ACTIVITY_ON_PHONE") https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startPhoneActivityWithUnlock(kotlin.String,kotlin.String,kotlin.String,android.net.Uri,kotlin.collections.List)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html callerPackage, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetPackage, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetAction, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html targetUri, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> targetCategories )` Starts an activity on the companion phone device, requesting a remote unlock. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html targetIntent, https://developer.android.com/reference/java/lang/String.html targetNodeId)` Start an activity on another device. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivityAttemptUnlock(android.net.Uri,kotlin.collections.List)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html targetUri, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> targetCategories )` Starts an activity on the companion phone device, requesting a remote unlock if supported and `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE()` is granted. |

## Constants

### ACTION_REMOTE_INTENT

```
public static final @NonNull String ACTION_REMOTE_INTENT
```

### PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE

```
public static final @NonNull String PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE
```

Permission required to use `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startPhoneActivityWithUnlock(kotlin.String,kotlin.String,kotlin.String,android.net.Uri,kotlin.collections.List)`.

### RESULT_FAILED

```
public static final int RESULT_FAILED = 1
```

Result code passed to `https://developer.android.com/reference/android/os/ResultReceiver.html#send(int, android.os.Bundle)` when a remote intent failed to send.

### RESULT_OK

```
public static final int RESULT_OK = 0
```

Result code passed to `https://developer.android.com/reference/android/os/ResultReceiver.html#send(int, android.os.Bundle)` when a remote intent was sent successfully.

### STATUS_AVAILABLE

```
public static final int STATUS_AVAILABLE = 3
```

Indicates that remote activity is available.

There is a connected device capable to handle the remote interaction.

### STATUS_TEMPORARILY_UNAVAILABLE

```
public static final int STATUS_TEMPORARILY_UNAVAILABLE = 2
```

Indicates that remote activity is temporarily unavailable.

There is a known paired device, but it is not currently connected or reachable to handle the remote interaction.

### STATUS_UNAVAILABLE

```
public static final int STATUS_UNAVAILABLE = 1
```

The remote auth's availability is unknown.

On older devices, `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_UNKNOWN()` is returned as we can not determine the availability states. To preserve compatibility with existing devices behavior, try `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)` and handle error codes accordingly.

### STATUS_UNKNOWN

```
public static final int STATUS_UNKNOWN = 0
```

The remote activity's availability is unknown.

## Public constructors

### RemoteActivityHelper

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

```
public RemoteActivityHelper(@NonNull Context context, @NonNull Executor executor)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | The `https://developer.android.com/reference/android/content/Context.html` of the application for sending the intent. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor` | `https://developer.android.com/reference/java/util/concurrent/Executor.html` used for getting data to be passed in remote intent. If not specified, default will be `Executors.newSingleThreadExecutor()`. |

## Public methods

### getAvailabilityStatus

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

```
public final @NonNull Flow<@NonNull Integer> getAvailabilityStatus()
```

Status of whether `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper` can `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)`, if known.

In scenarios of restricted connection or temporary disconnection with a paired device, `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)` will not be available. Please check `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#availabilityStatus()` before calling `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)` to provide better experience for the user.

Wear devices start to support determining the availability status from Wear Sdk WEAR_TIRAMISU_4. On older wear devices, it will always return `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_UNKNOWN()`. On phone devices, it will always return `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_UNKNOWN()`.

```kotlin
import androidx.wear.remote.interactions.RemoteActivityHelper

remoteActivityHelper.availabilityStatus.collect { status ->
    when (status) {
        RemoteActivityHelper.STATUS_UNAVAILABLE ->
            TODO("Hide or present alternative flow as remote flow is not available.")
        RemoteActivityHelper.STATUS_TEMPORARILY_UNAVAILABLE ->
            TODO("Present education to user to connect devices or bring to proximity.")
        RemoteActivityHelper.STATUS_AVAILABLE,
        RemoteActivityHelper.STATUS_UNKNOWN ->
            // Present normal remote device flow when we don't know (old devices)
            // or when we know it is available.
            remoteActivityHelper.startRemoteActivity(remoteIntent)
    }
}
```

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>` | a `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` with a stream of status updates that could be one of `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_UNKNOWN()`, `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_UNAVAILABLE()`, `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_TEMPORARILY_UNAVAILABLE()`, `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#STATUS_AVAILABLE()`. |

### getTargetIntent

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

```
public static final Intent getTargetIntent(@NonNull Intent intent)
```

Returns the `https://developer.android.com/reference/android/content/Intent.html` extra specifying remote intent.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent` | The intent holding configuration. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html` | The remote intent, or null if none was set. |

### getTargetNodeId

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

```
public static final String getTargetNodeId(@NonNull Intent intent)
```

Returns the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` extra specifying node ID of remote intent.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent` | The intent holding configuration. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | The node id, or null if none was set. |

### startPhoneActivityWithUnlock

Added in [1.3.0-rc01](https://developer.android.com/jetpack/androidx/releases/wear#1.3.0-rc01)

```
@RequiresApi(value = 37)
@RequiresPermission(value = "com.google.wear.permission.SEND_CONTINUE_ACTIVITY_ON_PHONE")
public final @NonNull ListenableFuture<@NonNull Void> startPhoneActivityWithUnlock(
    @NonNull String callerPackage,
    @NonNull String targetPackage,
    @NonNull String targetAction,
    @NonNull Uri targetUri,
    @NonNull List<@NonNull String> targetCategories
)
```

Starts an activity on the companion phone device, requesting a remote unlock.

This API requests to start an activity on the companion phone. If the phone is locked, it may also request to initiate unlocking the phone before launching the target application if below system conditions allow it.

This API is only available on API 37 and above.

To use this function, the following conditions must be met:

- Note that this method only works when it's called from the watch.

- The calling application must be granted `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE()`.

- The `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startPhoneActivityWithUnlock(kotlin.String,kotlin.String,kotlin.String,android.net.Uri,kotlin.collections.List)` must be the same package (or a trusted peer application) on the connected phone, and its SHA1 certificate fingerprint must match the source package on the watch. The `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startPhoneActivityWithUnlock(kotlin.String,kotlin.String,kotlin.String,android.net.Uri,kotlin.collections.List)` must also accurately match the calling app's package name.

- The caller application must be running in the foreground when the request is made.

- The request must be the direct result of an explicit user interaction (for example, tapping a "show on phone" button).

- User should have enrolled in the feature.

- An active authentication session must exist between the devices. This requires both devices support the feature, the watch is currently unlocked and near the phone while they are connected via Bluetooth, and the phone has been unlocked by the user at least once *after* the watch was unlocked and placed on the user's body.

There are no restrictions on `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startPhoneActivityWithUnlock(kotlin.String,kotlin.String,kotlin.String,android.net.Uri,kotlin.collections.List)`, `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startPhoneActivityWithUnlock(kotlin.String,kotlin.String,kotlin.String,android.net.Uri,kotlin.collections.List)` or `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startPhoneActivityWithUnlock(kotlin.String,kotlin.String,kotlin.String,android.net.Uri,kotlin.collections.List)` as long as they are not empty.

Use this method to launch explicitly targeted intents (specifying target package, action, URI, and categories) instead of public browsable links, and if your flow strictly requires an unlocked phone without automatic fallbacks.

**Exception Conditions:**

- `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html`: Thrown if `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE()` has not been granted.

- `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html`: Thrown if any of the required parameters are empty.

- `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html`: Thrown if this remote unlock API is unsupported on this device.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html callerPackage` | The package name of the calling app. This is required. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetPackage` | The package name of the activity to start on the phone. This is required. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetAction` | The action of the activity to start on the phone. This is required. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html targetUri` | The data URI of the activity to start on the phone. This is required and cannot be empty. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> targetCategories` | The categories of the activity to start on the phone. This is required. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | A `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` which resolves if the request was successfully sent, or throws an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-exception/index.html` if the request failed or the parameters were invalid. If there's a problem with starting remote activity, `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper.RemoteIntentException` will be thrown. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | If `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE()` has not been granted. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If any of the required parameters are empty. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` | If this remote unlock API is unsupported on this device. |

### startRemoteActivity

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

```
public final @NonNull ListenableFuture<@NonNull Void> startRemoteActivity(@NonNull Intent targetIntent, String targetNodeId)
```

Start an activity on another device.

This API currently supports sending intents with action set to `https://developer.android.com/reference/android/content/Intent.html#ACTION_VIEW`, a data URI populated using `https://developer.android.com/reference/android/content/Intent.html#setData(android.net.Uri)`, and with the category `https://developer.android.com/reference/android/content/Intent.html#CATEGORY_BROWSABLE` present.

When `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)` is unspecified, if the current device is a watch, the activity will start on the companion phone device. Otherwise, the activity will start on all connected watch devices.

If the intent passed in sets a different action or does not contain the CATEGORY_BROWSABLE category or does not set a data URI, the call will be rejected and a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` thrown.

Besides the mandated action and category, the caller must provide a data URI and an optional set of categories to be delivered to the remote device.

If any additional attributes of the intent are set (for examples, extras, package, component), they will be stripped from the intent. Only an intent with ACTION_VIEW, CATEGORY_BROWSABLE, any other specified categories, and the provided data URI will be delivered to the remote devices.

From Wear 6, the Wear SDK on the Watch will be used for starting remote activities on the connected companion.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html targetIntent` | The intent to open on the remote device. Action must be set to `https://developer.android.com/reference/android/content/Intent.html#ACTION_VIEW`, a data URI must be populated using `https://developer.android.com/reference/android/content/Intent.html#setData(android.net.Uri)`, and the category `https://developer.android.com/reference/android/content/Intent.html#CATEGORY_BROWSABLE` must be present. |
| `https://developer.android.com/reference/java/lang/String.html targetNodeId` | Wear OS node id for the device where the activity should be started. If null, and the current device is a watch, the activity will start on the companion phone device. Otherwise, the activity will start on all connected watch devices. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | The `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` which resolves if starting activity was successful or throws `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-exception/index.html` if any errors happens. If there's a problem with starting remote activity, `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper.RemoteIntentException` will be thrown. |

### startRemoteActivityAttemptUnlock

Added in [1.3.0-rc01](https://developer.android.com/jetpack/androidx/releases/wear#1.3.0-rc01)

```
public final @NonNull ListenableFuture<@NonNull Void> startRemoteActivityAttemptUnlock(
    @NonNull Uri targetUri,
    @NonNull List<@NonNull String> targetCategories
)
```

Starts an activity on the companion phone device, requesting a remote unlock if supported and `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE()` is granted.

The remote unlock aspect of the request is subject to a strict set of security conditions:

- The remote unlock part is only applicable when the request is initiated from a Wear OS watch.

- The calling application must be granted `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#PERMISSION_SEND_CONTINUE_ACTIVITY_ON_PHONE()`.

- The app must be in the foreground.

- The request must be the result of explicit user interaction.

- User should have enrolled in the feature.

- An active authentication session must exist between the devices. This requires both devices support the feature, the watch is currently unlocked and near the phone while they are connected via Bluetooth, and the phone has been unlocked by the user at least once *after* the watch was unlocked and placed on the user's body.

To initiate the launch, this method will generate an intent with an `https://developer.android.com/reference/android/content/Intent.html#ACTION_VIEW` action, the provided `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivityAttemptUnlock(android.net.Uri,kotlin.collections.List)`, and the caller's `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivityAttemptUnlock(android.net.Uri,kotlin.collections.List)` (which must include `https://developer.android.com/reference/android/content/Intent.html#CATEGORY_BROWSABLE` category).

If remote unlock is not supported or conditions are not met (for example, missing permission, or if the authentication session ends), this method falls back to `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)` behavior. In this case, no remote unlock will be requested and the user will have to manually unlock their phone if it is locked before activity is launched.

Use this method for broad compatibility on watches, providing an easy upgrade path for existing users of `https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper#startRemoteActivity(android.content.Intent,kotlin.String)`. On API 37 and above, this method attempts unlocking the phone, automatically falling back to a standard remote launch if unavailable. On API below 37, it functions as a standard remote launch. Intents must match the listed limitations.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html targetUri` | The data URI of the activity to start on the phone. This must not be empty. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> targetCategories` | The categories of the activity to start on the phone. This must contain `https://developer.android.com/reference/android/content/Intent.html#CATEGORY_BROWSABLE`. If not specified, by default it will be `https://developer.android.com/reference/android/content/Intent.html#CATEGORY_BROWSABLE`. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Void.html>` | A `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` which resolves if the request was successfully sent, or throws an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-exception/index.html` if the request failed or the parameters were invalid. |