java.lang.Object | |
↳ | com.google.android.gms.cast.Cast |
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
addApi(Api extends Api.ApiOptions.NotRequiredOptions>)
. Once you have your GoogleApiClient
, call
connect()
and wait for the
onConnected(Bundle)
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.”
Nested Classes | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Cast.ApplicationConnectionResult |
When a connection to a receiver application has been established, this object contains
information about that application, including its ApplicationMetadata and current
status.
|
||||||||||||||||||||||||||||||||
Cast.CastApi | The main entry point for interacting with a Google Cast device. | ||||||||||||||||||||||||||||||||
Cast.CastOptions |
API configuration parameters for Cast .
|
||||||||||||||||||||||||||||||||
Cast.Listener |
The list of Cast callbacks.
|
||||||||||||||||||||||||||||||||
Cast.MessageReceivedCallback |
The interface to process received messages from a CastDevice .
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXTRA_APP_NO_LONGER_RUNNING |
A boolean extra for the connection hint bundle passed to onConnected(Bundle)
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. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
API |
Token to pass to addApi(Api extends Api.ApiOptions.NotRequiredOptions>) to enable the Cast features.
|
||||||||||
CastApi | An implementation of the CastApi interface. |
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
A boolean extra for the connection hint bundle passed to onConnected(Bundle)
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.
Token to pass to 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.