page.title=Google Cast Android API page.tags="chromecast","miracast" header.hide=1 @jd:body
Adding support for Google Cast requires that you provide a companion app on the
Google Cast device, known as the receiver app. If your app streams audio or video content
using one of several supported media types, then you can create a receiver app with your
own style and branding by creating nothing more than a CSS file.
Create a Styled Media Receiver
If the Styled Media Receiver does not provide the UI components required for your
receiver app or does not support the media types your app requires, you can build your
own receiver app as a web page using the JavaScript Receiver API.
Create a Custom Receiver
To allow users to control playback on the receiver app, you can add a
controller interface to your app on Android, iOS, and Chrome. The client app on these devices
is known as the sender app and can perform a variety of actions using the Google Cast APIs
such as start and pause playback and control the volume on the Google Cast device.
Create a Sender App
The Google Cast Android APIs are part of the Google Play services platform.
To get started, set up the Google Play services SDK on your development machine and be sure your test device has Google Play services 4.2 (or higher) installed.
Before you can develop and test apps on your own Google Cast device, you need to acquire an app ID for your API calls and register your Google Cast device (such as a Chromecast) as a development device. For details, read the Registration guide.
To provide the perfect user experience when casting your content to TVs, be sure your app follows all the recommendations in the Design Checklist.
Read the Developer's Guide to learn how to implement the receiver app and how to send it commands from your Android app.
For quick access while developing your Android app, the Google Cast Android API reference is available here on developer.android.com.