public final class RemoteActivityHelper
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(
nodeId is the opaque string that represents a 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.
Start an activity on another device.
public final RemoteActivityHelper(@NonNull Context context, @NonNull Executor executor)
public final ListenableFuture<@NonNull Void> startRemoteActivity(
@NonNull Intent targetIntent,
@Nullable String targetNodeId
Start an activity on another device. This api currently supports sending intents with action set to
android.content.Intent.ACTION_VIEW, a data uri populated using
android.content.Intent.setData, and with the category
android.content.Intent.CATEGORY_BROWSABLE present. 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.
The intent to open on the remote device. Action must be set to
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.