Search code examples
androidgoogle-cast

VideoCast Sample App on Android does not detect cast device


I have downloaded and built the CastCompanionLibrary and CastVideos-android sample code from github, after updating google play services library etc.

I have modified the strings file to enter my AppId.

I have a test device configured in the developer console, and also I configured an app (is the sample video app in this case) and I entered the same package name as in the AndroidManifest.xml for the app.

The app start, runs and shows lists of videos - but does not seem to detect the chromecast device as on button is added to the ActionBar.

I am now trying to publish the sample app to see if that fixes it, but following the instructions and using the stock sample code is not working for me so far.

What am I doing wrong?


Solution

  • OK here is my summary of things I had to do to get things working with an unpublished app:

    • Double-check the Device ID. It's difficult to read and some characters could be wrong. Taking a photo in good lighting is a good idea.

    • Configure the device in the dev console (https://cast.google.com/publish/#/overview), register it and wait. Then later I had to reboot my Chromecast device (in fact twice). I used the chromecast app (Mac OS X) which you can download from here: https://cast.google.com/chromecast/setup

    • I had poor Wi-Fi performance that made my Android device change WiFi SSID to a different one from where the ChromeCast was connected. Latest versions of Android seem to test response time and bandwidth and then may change if deemed "unstable" (I had it overloaded with downloads) and there is another better one available. So, double check you are on the correct WiFi on Android.

    • Off course, configure the app in the dev console and past the (Case Sensitive) app id into the app_id string in the strings.xml file in the Android res/values folder.

    I think that´s all. Happy casting!