# com.google.ambient.crossdevice.sessions

# com.google.ambient.crossdevice.sessions

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/package-summary "View this page in Kotlin")\|Java

## Annotations

|--------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [SessionException.SessionErrorCode](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionException.SessionErrorCode) |   |

## Interfaces

|----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ApplicationSessionTagMatcher](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ApplicationSessionTagMatcher)       | Defines how two[ApplicationSessionTag](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ApplicationSessionTag)should be matched.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [OriginatingSession](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/OriginatingSession)                           | Describes a Session that is in the process of being transferred to another device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [OriginatingSessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/OriginatingSessionStateCallback) | Clients of Sessions should implement`OriginatingSessionStateCallback`to receive notifications of Session state changes when transferring a Session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [PrimarySession](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/PrimarySession)                                   | When a Session becomes shared with one or more devices, this interface represents the Primary device (the Session owner).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [PrimarySessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/PrimarySessionStateCallback)         | Clients of Sessions should implement`PrimarySessionStateCallback`to receive notifications of Session state changes when acting as the Primary for a Shared Session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [ReceivingSession](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ReceivingSession)                               | Describes a Session that is in the process of being transferred to another device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [ReceivingSessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ReceivingSessionStateCallback)     | Clients of Sessions should implement`ReceivingSessionStateCallback`to receive notifications of Session state changes when transferring a Session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [SecondarySession](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SecondarySession)                               | When a Session becomes shared with one or more devices, this interface represents a secondary device (a device that has joined an existing Session).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [SecondarySessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback)     | Clients of Sessions should implement`SecondarySessionStateCallback`to receive notifications of Session state changes when acting as the Secondary for a shared Session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [SessionConnectionReceiver](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionConnectionReceiver)             | Receiver callback for a[SessionRemoteConnection](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection).                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [SessionParticipant](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionParticipant)                           | Represents an individual device that is participating in a Session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [SessionRemoteConnection](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionRemoteConnection)                 | A connection to a remote device that is participating in a Session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [SessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionStateCallback)                       | Grants access to client-provided callbacks[OriginatingSessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/OriginatingSessionStateCallback),[ReceivingSessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ReceivingSessionStateCallback),[PrimarySessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/PrimarySessionStateCallback)and[SecondarySessionStateCallback](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback). |
| [Sessions](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/Sessions)                                               | Entry-point for creating and interacting with Sessions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [TransferrableSession](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/TransferrableSession)                       | Describes methods that are common to both originating and receiving sides of a Session transfer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

## Classes

|----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ApplicationSessionTag](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ApplicationSessionTag)   | An identifier that allows apps to differentiate between multiple types of sessions.                                                                                                                                                                                                                                                                                                                                                                                                   |
| [ExactSessionTagMatcher](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ExactSessionTagMatcher) | An[ApplicationSessionTagMatcher](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ApplicationSessionTagMatcher)that matches[ApplicationSessionTag](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ApplicationSessionTag)objects when their[ApplicationSessionTag.sessionTag](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/ApplicationSessionTag#sessionTag())strings are the same. |
| [SessionId](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionId)                           | An identifier that uniquely describes an individual Session.                                                                                                                                                                                                                                                                                                                                                                                                                          |

## Exceptions

|----------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [SessionException](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionException) | Exception for session requests. |