1

I am new to Android development and I am trying to use the Android's Cast API. To start I have cloned and used the CastHelloText demo app. But there should be a cast button in the ActionBar/ToolBar which is for some reason not visible. I haven't registered any app to Cast Developer Console, I am just using the project as is, which means I am using the app id mentioned in their project. Does the chromecast device need to be powered on and plugged in and the android phone with the app be near/in front of the tv in order to make the button visible? I am a little confused as there is nothing mentioned anything like this in the documentation.

Kara
  • 6,115
  • 16
  • 50
  • 57

1 Answers1

0

Your chromecast device should be powered on and on the same network as your phone (same wifi network on both). You do't need to be in front/near the TV as long as both devices are on the same wifi network but I presume you do want to be able to see the TV's screen to see if your app works or not, don't you?

Ali Naddaf
  • 16,951
  • 2
  • 21
  • 28
  • Thanks for the reply, and yes I do need to be in front of the tv. So that means the cast button won't be visible until the phone and the chromecast device both are on the same wifi network? Then how can I let users know my app has casting ability? –  May 10 '16 at 17:39
  • Why do you need the cast icon to be visible in order to tell your uses that your app is cast enabled? You can choose to show some sort of one-time tutorial/introductory page for your users, to let them know that your app is not cast-enabled and to take advantage of that, they need a chromecast, etc. Cast button, by design, is visible only if there is a cast device on the same wifi network and if that cast device can run your app; owners of Cast devices can choose to enable the guest mode that then relaxes the wifi network requirement but requires the phone to be near the TV. – Ali Naddaf May 10 '16 at 20:23
  • A couple of typos in the last comment: "...to let them know that your app is now cast-enabled and..." – Ali Naddaf May 11 '16 at 07:59
  • 1 more thing I need to ask , don't know if I should write another question or not. Is it possible to connect multiple senders to 1 receiver ? (With either cast api or remote display api)? –  May 11 '16 at 13:44
  • With Cast Api, you can certainly do that (it is a very common scenario). With RemoteDisplay, you cannot. – Ali Naddaf May 11 '16 at 14:14
  • Okay. But what other code do I have to write to make that happen... Because when I connected the castvideos demo with one sender... Trying to connect with another resulted in 1st one being disconnected –  May 11 '16 at 14:42
  • CastVideos-android (and its default receiver) support multiple connections; in fact, there is not much you can do on the sender side to stop other senders from connecting to the same chromecast; receiver, however, can easily control that since it knows when new devices are connected and unless it tells the senders, they don't know of the presence of other connected senders. If you have more questions on this, it is a better idea to open a new post since this is not related to the original question. – Ali Naddaf May 11 '16 at 16:18