Stay organized with collections
Save and categorize content based on your preferences.
SessionRemoteConnection
@RequiresApi(value = 26) interface SessionRemoteConnection
A connection to a remote device that is participating in a Session. This is a wrapper around RemoteConnection
updated to be specific to SessionParticipant
.
Summary
Public fields
Public methods
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# SessionRemoteConnection\n=======================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionRemoteConnection \"View this page in Kotlin\") \\|Java\n\n\n```\n@RequiresApi(value = 26) interface SessionRemoteConnection\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA connection to a remote device that is participating in a Session. This is a wrapper around [RemoteConnection](/reference/com/google/ambient/crossdevice/connections/RemoteConnection) updated to be specific to [SessionParticipant](/reference/com/google/ambient/crossdevice/sessions/SessionParticipant).\n\nSummary\n-------\n\n| ### Public fields ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `abstract @`[NonNull](/reference/androidx/annotation/NonNull)` `[SessionParticipant](/reference/com/google/ambient/crossdevice/sessions/SessionParticipant) | [participant](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#participant()) The participant this this is a connection to. |\n\n| ### Public methods ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `abstract void` | [registerReceiver](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#registerReceiver(com.google.ambient.crossdevice.sessions.SessionConnectionReceiver))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[SessionConnectionReceiver](/reference/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver)` receiver)` Registers the given [SessionConnectionReceiver](/reference/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver) with this channel. |\n| `abstract @`[NonNull](/reference/androidx/annotation/NonNull)` `[Result](/reference/kotlin/Result)`\u003c`[Unit](/reference/kotlin/Unit)`\u003e` | [send](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#send(kotlin.ByteArray))`(@`[NonNull](/reference/androidx/annotation/NonNull)` byte[] bytes)` See [RemoteConnection.send](/reference/com/google/ambient/crossdevice/connections/RemoteConnection#send(kotlin.ByteArray)) |\n| `abstract @`[NonNull](/reference/androidx/annotation/NonNull)` `[ListenableFuture](/reference/com/google/common/util/concurrent/ListenableFuture)`\u003c`[Void](/reference/java/lang/Void)`\u003e` | [sendFuture](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#sendFuture(kotlin.ByteArray))`(@`[NonNull](/reference/androidx/annotation/NonNull)` byte[] bytes)` Java-compatible version of [send](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#send(kotlin.ByteArray)). |\n| `abstract void` | [unregisterReceiver](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#unregisterReceiver(com.google.ambient.crossdevice.sessions.SessionConnectionReceiver))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[SessionConnectionReceiver](/reference/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver)` receiver)` Unregisters a given receiver from the remote device. |\n\nPublic fields\n-------------\n\n### participant\n\n```\nabstract @NonNull SessionParticipant participant\n```\n\nThe participant this this is a connection to.\n\nPublic methods\n--------------\n\n### registerReceiver\n\n```\nabstract void registerReceiver(@NonNull SessionConnectionReceiver receiver)\n```\n\nRegisters the given [SessionConnectionReceiver](/reference/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver) with this channel. \n\n| Throws ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------|\n| [com.google.ambient.crossdevice.connections.ConnectionsException](/reference/com/google/ambient/crossdevice/connections/ConnectionsException)` com.google.ambient.crossdevice.connections.ConnectionsException` | if the connection is closed. |\n\n### send\n\n```\nabstract @NonNull Result\u003cUnit\u003e send(@NonNull byte[] bytes)\n```\n\nSee [RemoteConnection.send](/reference/com/google/ambient/crossdevice/connections/RemoteConnection#send(kotlin.ByteArray)) \n\n### sendFuture\n\n```\nabstract @NonNull ListenableFuture\u003cVoid\u003e sendFuture(@NonNull byte[] bytes)\n```\n\nJava-compatible version of [send](/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection#send(kotlin.ByteArray)). \n\n### unregisterReceiver\n\n```\nabstract void unregisterReceiver(@NonNull SessionConnectionReceiver receiver)\n```\n\nUnregisters a given receiver from the remote device."]]