I was running the android sample app "Hello text" on an emulator. Everything worked fine expect the cast button didn't show up in the action bar. I was wondering if I understood the design of the sample app correctly. I thought there would be a cast button on the top bar if there was at least one chromecast device available. I'm sure my laptop and chromecast were configured correctly, because I was able to run my IOS app on the same laptop and same chromecast. But when I ran the android sample app, I could only do speech recognition. What I did for my eclipse project: I went to the device manager and install ed the google play services rev 15, and android sdk support library 19. Then I imported the support-v7-appcompat and support-v7-mediarouter from the support library 19 to the workplace. I also imported the google play services lib to the workplace. I changed the app_id in the sample app, and added the dependencies(aforementioned google play service lib and two support projects). Plus, I did install google API 19 and create a new emulator instance based this target. Could anyone help me figure out what I did wrong? Thank you very much!
Asked
Active
Viewed 1,061 times
0
-
What do you mean by "cast button"?! – Phantômaxx Feb 15 '14 at 08:35
-
I mean something like a media route button. I basically just use the sample app "Cast Hello Text" on their github. I suppose there should be a button that a user can click to display a list of chromecasts – user2600593 Feb 15 '14 at 08:50
-
@rajshree, the same as the android CastHelloText on their github. Their approach for cast device listing and selection is using the MediaRouteActionProvider. Basically the android system will put a media button in the action bar(at the top). When a user click the button(I assume it is a chromecast logo), then a list view of available devices will pop up. But I can't get the button to show up on my emulator. Maybe I misunderstood their app function? – user2600593 Feb 15 '14 at 08:58
-
@rajshree https://github.com/googlecast/CastHelloText-android could you have a look at the their sample app, or have a test? Thank you very much! It would be really helpful. – user2600593 Feb 15 '14 at 18:56
1 Answers
0
- Make sure you have followed all the steps, i.e. registering for an appid and put the appid in your project, see this site for instructions
- Make sure your device is whitelisted for your appid, instructions are on the same page, if run into issues, check out this post as well
- Use a real device; emulator won't be able to do mDNS discovery

Community
- 1
- 1

Ali Naddaf
- 16,951
- 2
- 21
- 28
-
Hi Ali, Thank you for your replay. My app is actually public. I published it on IOS a week ago, and it works well on any chromecast. So I don't think I have to whitelist devices to make it work. Now I tried on my nexus, it still doesn't work. PS, I did test youtube on my nexus, it works. – user2600593 Feb 15 '14 at 18:53
-
So your app on iOS with the same App Id works and on Android, with that very same App Id doesn't work, is that correct? If so, do you see any suspicious item in the logs? App IDs are case sensitive, have you entered that correctly? – Ali Naddaf Feb 15 '14 at 22:44
-
Correct. The same app id worked for IOS but not for android. I copied the app ID from the developer console. I didn't see any suspicious item on the log. But I do feel suspicious about how few the log is. Because I'm one of the first chromecast test developers, in the old sdk, we have a thread dedicated for 'dialing', so we can see the detecting process even if there is no chromecast available, but now I didn't see similar items related to device searching. – user2600593 Feb 15 '14 at 23:59
-
Likewise, I got the similar symptom in the other sample app "CastVideo". After the app was launched, I saw CastDeviceScannerIntentService(943): Starting operation: >> ayx and then CastDeviceScannerIntentService(943): Finished operation: >> ayv (1ms elapsed) Then it basically stopped searching. – user2600593 Feb 16 '14 at 00:01
-
Can you go to your settings -> apps and report back the version of Google Play Services? – Ali Naddaf Feb 16 '14 at 01:55
-
-
That is the right version. So I guess I need to see your code; can you share that so we can see what is happening there? – Ali Naddaf Feb 16 '14 at 06:12
-
Sure. Actually I was just running the sample app from github. It is "castHelloText", https://github.com/googlecast/CastHelloText-android – user2600593 Feb 16 '14 at 07:03
-
-
As a quick test, please use this as your appid: "CC1AD845" (case sensitive) and see if the cast icon shows up or not. This is a different receiver so you won't be able to use it for your app but I want to see if using that app id makes the cast button visible or not. – Ali Naddaf Feb 16 '14 at 07:13
-
No it didn't show up. So I guess I didn't configure the library correctly? By the way, thank you very much for helping me. – user2600593 Feb 16 '14 at 07:46
-
yes, looks like something is not quite right on your end. There is a sample code in the Android SDK under extras/google/google_play_services/samples/cast/democastplayer. Grab that and compile and run that. Then if you go to the settings page in that app, you can enter any app id you want; once enter your app id, and then try the app id I gave you and see if you can get the cast icon show up; in the first page of the app, select Cast SDK. – Ali Naddaf Feb 16 '14 at 08:23
-
Yes.The cast button showed up using my project configuration in Eclipse. – user2600593 Feb 16 '14 at 09:19
-
And I am able to cast the receiver app you gave me which shows a cast icon on my screen. – user2600593 Feb 16 '14 at 09:20
-
This is weird. The selector app mysteriously 'waked' up my nexus, now the cast button appeared even in the 'CastHelloText' app. I didn't change any bit of the code. Thank you very much! – user2600593 Feb 16 '14 at 09:27