4

I'm learning cast api for android and I'm stuck at this part:

mMediaRouteSelector = new MediaRouteSelector.Builder()
  .addControlCategory(CastMediaControlIntent.categoryForCast("YOUR_APPLICATION_ID"))
  .build();

Where can I find this APPLICATION_ID and what is it?

ucMedia
  • 4,105
  • 4
  • 38
  • 46
Lucas Bertollo
  • 373
  • 2
  • 5
  • 19

2 Answers2

7

Unfortunately, when doing Google Cast Android Sender Application tutorial, you should do multiple steps not described well on site to develop Chromecast applications:

  1. You must sign up (yes, pay 5$) for Google Cast SDK
  2. After this process, I suggest you to add your device serial number in Google Cast SDK Developer Console since it's 15 minute long process. More details about this process you can find on Google Cast Registration page
  3. While waiting for device registration, add your application on Google Cast SDK Developer Console by clicking on Add new Application. Choose Styled Media Receiver in next step, and you can put anything in Application Name
  4. By saving application, you'll get YOUR_APPLICATION_ID
  5. After 15 minutes (or when adding device is ready), don't forget to do step 6. and 7. from Google Cast Registration page
    • In the Chromecast setup app, select your Chromecast and check the box, Send this Chromecast's serial number when checking for updates.
    • Restart your Cast device: disconnect the power or USB cable from the device, then reconnect it (or you can simply click reboot on Chromecast setup app)
Tomo
  • 6,847
  • 1
  • 22
  • 32
  • 1
    All the necessary steps are documented if you read the docs: https://developers.google.com/cast/docs/developers – Ali Naddaf Jan 05 '15 at 23:09
  • Ali Naddaf, the above descriptions are precisely correct, while the tutorial doc you are pointing to is a timethief even on such a simple matter as using the default app id, which is seemingly not implemented at all: java.lang.IllegalArgumentException: Invalid application ID: CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID – carl Apr 28 '16 at 13:18
2

I think you need to register your application on the dashboard here.

After registration, you would be given a APPLICATION ID for your application, which you can then use for development.

Excerpt from the documentation :

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.

Swayam
  • 16,294
  • 14
  • 64
  • 102
  • So your saying that i must pay and buy a chrome device to develop something? – Lucas Bertollo Oct 19 '14 at 19:28
  • If you are building a Custom Receiver, then yes. Go through this : https://developers.google.com/cast/docs/registration – Swayam Oct 19 '14 at 19:30
  • 1
    You don't need to register if you can use the Default Receiver (see the cast documentation) but even if you do that, you still need to have a chromecast device to run the app and develop it; without that, it is almost impossible to develop something for chromecast (or another Cast device like an Android TV). – Ali Naddaf Oct 19 '14 at 20:38