CastDevice | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public class

# CastDevice

extends Object
implements SafeParcelable

java.lang.Object
↳ | com.google.android.gms.cast.CastDevice

## Class Overview

An object representing a Cast receiver device.

## Summary

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |
From interface com.google.android.gms.common.internal.safeparcel.SafeParcelable
String | NULL |

Fields
public static final Creator<CastDevice> | CREATOR |

Public Methods
int | describeContents()
boolean | equals(Object obj)
String | getDeviceId() Gets the unique ID for the device.
String | getDeviceVersion() Gets the device's version.
String | getFriendlyName() Gets the friendly name for the device.
static CastDevice | getFromBundle(Bundle extras) Returns the CastDevice from `extras`, otherwise `null`.
WebImage | getIcon(int preferredWidth, int preferredHeight) Returns a best-fit icon for the requested icon size.
List<WebImage> | getIcons() Returns a list of all of the device's icons.
Inet4Address | getIpAddress() Gets the IPv4 address of the device.
String | getModelName() Gets the model name for the device.
int | getServicePort() Gets the device's service port.
boolean | hasIcons() Checks if the device has any icons.
int | hashCode() Overridden to return a hashcode of the device ID.
boolean | isSameDevice(CastDevice castDevice) Tests if this device refers to the same physical Cast device as `castDevice`.
void | putInBundle(Bundle bundle) Writes the CastDevice to `bundle`.
String | toString() Returns a string representation of the device.
void | writeToParcel(Parcel out, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Fields

#### public static final Creator<CastDevice> CREATOR

## Public Methods

#### public int describeContents ()

#### public boolean equals (Object obj)

#### public String getDeviceId ()

Gets the unique ID for the device.

#### public String getDeviceVersion ()

Gets the device's version.

#### public String getFriendlyName ()

Gets the friendly name for the device.

#### public static CastDevice getFromBundle (Bundle extras)

Returns the CastDevice from `extras`, otherwise `null`.

#### public WebImage getIcon (int preferredWidth, int preferredHeight)

Returns a best-fit icon for the requested icon size.

#### public List<WebImage> getIcons ()

Returns a list of all of the device's icons. If there are no images, returns an empty list.

#### public Inet4Address getIpAddress ()

Gets the IPv4 address of the device.

#### public String getModelName ()

Gets the model name for the device.

#### public int getServicePort ()

Gets the device's service port.

#### public boolean hasIcons ()

Checks if the device has any icons.

#### public int hashCode ()

Overridden to return a hashcode of the device ID.

#### public boolean isSameDevice (CastDevice castDevice)

Tests if this device refers to the same physical Cast device as `castDevice`. Two `CastDevice`s are considered to refer to the same physical device if they have the same device ID.

##### Parameters

castDevice | The `CastDevice` to test.

##### Returns

- `true` if the device IDs are the same, else `false`.

#### public void putInBundle (Bundle bundle)

Writes the CastDevice to `bundle`.

#### public String toString ()

Returns a string representation of the device.

#### public void writeToParcel (Parcel out, int flags)