Main entry point for the Cast APIs. This class provides APIs and interfaces to access Google Cast devices.
To use the service, construct a GoogleApiClient.Builder
and pass API to
GoogleApiClient.Builder.addApi(Api extends Api.ApiOptions.NotRequiredOptions>
). Once you have your GoogleApiClient,
call GoogleApiClient.connect()
and wait for the GoogleApiClient.ConnectionCallbacks#onConnected method to be
called.
Device discovery on Android is performed using the Android MediaRouter APIs that debuted in Jellybean MR2 (API level 18). The MediaRouter APIs are implemented in the Android v7 Support Library. These APIs provide a simple mechanism for discovering media destinations, such as Chromecasts, bluetooth speakers, Android-powered smart TVs, and other media playback devices; and for routing media content to and controlling playback on those endpoints. These endpoints are referred to as “media routes.”
| interface | Cast.ApplicationConnectionResult | The result of a call to one of the
Cast.CastApi.launchApplication(GoogleApiClient, String) or
Cast.CastApi.joinApplication(GoogleApiClient) methods. |
|
| interface | Cast.CastApi | This interface is deprecated. See Migrate Android Sender App from Cast SDK v2 to v3. | |
| class | Cast.CastOptions | API configuration parameters for Cast. |
|
| class | Cast.Listener | The list of Cast
callbacks. |
|
| interface | MessageReceivedCallback | The interface to process received messages from
a CastDevice. |
|
| int | ACTIVE_INPUT_STATE_NO | A constant indicating that the Google Cast device is not the currently active video input. |
| int | ACTIVE_INPUT_STATE_UNKNOWN | A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is the currently active video input. |
| int | ACTIVE_INPUT_STATE_YES | A constant indicating that the Google Cast device is the currently active video input. |
| String | EXTRA_APP_NO_LONGER_RUNNING | A boolean extra for the connection hint bundle
passed to GoogleApiClient.ConnectionCallbacks#onConnected that indicates
that the connection was re-established, but the receiver application that was in use
at the time of the connection loss is no longer running on the receiver. |
| int | MAX_MESSAGE_LENGTH | The maximum raw message length (in bytes) that is supported by a Cast channel. |
| int | MAX_NAMESPACE_LENGTH | The maximum length (in characters) of a namespace name. |
| int | STANDBY_STATE_NO | A constant indicating that the Google Cast device is not currently in standby. |
| int | STANDBY_STATE_UNKNOWN | A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is currently in standby. |
| int | STANDBY_STATE_YES | A constant indicating that the Google Cast device is currently in standby. |
| public static final Api<Cast.CastOptions> | API | Token to pass to
GoogleApiClient.Builder.addApi(Api extends Api.ApiOptions.NotRequiredOptions>
) to enable the Cast features. |
| public static final Cast.CastApi | CastApi | An implementation of the CastApi interface. |
A constant indicating that the Google Cast device is not the currently active video input.
A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is the currently active video input. Active input state can only be reported when the Google Cast device is connected to a TV or AVR with CEC support.
A constant indicating that the Google Cast device is the currently active video input.
A boolean extra for the connection hint bundle passed to
GoogleApiClient.ConnectionCallbacks#onConnected that indicates that the
connection was re-established, but the receiver application that was in use at the time
of the connection loss is no longer running on the receiver.
The maximum raw message length (in bytes) that is supported by a Cast channel.
The maximum length (in characters) of a namespace name.
A constant indicating that the Google Cast device is not currently in standby.
A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is currently in standby. Standby state can only be reported when the Google Cast device is connected to a TV or AVR with CEC support.
A constant indicating that the Google Cast device is currently in standby.
Token to pass to
GoogleApiClient.Builder.addApi(Api extends Api.ApiOptions.NotRequiredOptions>
) to enable the Cast features.
An implementation of the CastApi interface. The interface is used to interact with a cast device.