Reputation: 61
Does anyone know is it possible to integrate the Google Cast SDK in a native Android TV App as a receiver app? My understanding from the documentation is like it only works with cast receiver applications provided from a server and written in HTML5/JavaScript not in Java.But some of the applications on the Android TV seems to support cast receiver when I connect my smartphone(e.g Netflix,Youtube) Am I missing something on the documentation? It would great if someone give a pointer on this topic (Google Cast Receiver applications using java code)
Upvotes: 2
Views: 1669
Reputation: 2771
Yes it is, copied from my own answering the same question:
Yes! on September 2020 Google release the Android Receiver SDK for Android TV. This is the official site: https://developers.google.com/cast/docs/android_tv_receiver
This is the Google Codelab https://codelabs.developers.google.com/codelabs/cast-connect-atv
Basically you will need the sender app and the receiver app. Usually the sender app is the phone app and the receiver app will be the Android TV app. It can also be the same apk. For example the same app could handle phone layout and be the Sender App and the same app could handle TV layouts and be the receiver app.
In any case you will need to create an Application in: https://cast.google.com/publish
And Follow the instructions how to add an Android TV dongle via the Chromecast Built-in Serial Number. Everything is well documented.
Take also in mind that you will need to re-think how the sender and the receiver app works and synch the ExpandedControllerActivity in your Sender App with your player (if your app is a streaming app).
NOTE: With this approach you DO NOT NEED any web receiver app BUT any Android TV without your app installed won't work with this "receiver". Ideally you will need the Web receiver and this new Android TV receiver it is just a plus to allow your users has a better UX while using your Android TV app.
Upvotes: 0
Reputation: 458
The receiver application is always written in html,css and js. When apps like Youtube or Netflix support casting, they have a receiver app (which has been suitably registered, published and deployed) which is loaded on to Chromecast when the user clicks on cast-icon. The Youtube or Netflix App on android platform is acting as a sender application to Chromecast .
There is no Java SDK for receiver application. Even the concept on one does not make sense as the objective is to stream/display media on TV using the Chromecast. You are never casting from one Android/IOS device to another.
Upvotes: 2