I am looking to build a sample app that has the capability to just cast my android screen on to the TV screen. Most of the sample applications(including googles official sample cast applications) I see have the capability to cast audio and video as well. I know their is google's chromecast app which does the same(screen mirroring), but I need to integrate same functionality in my app. So any kind of code example or tutorial that point me in the direction of screen mirroring using cast SDK will be much appreciated.
Asked
Active
Viewed 5,829 times
1 Answers
3
You cannot programmatically initiate mirroring your phone screen outside of your app; you can only use the Remote Display APIs to mirror a view from within your own app; read about the Remote Display apis.

Ali Naddaf
- 16,951
- 2
- 21
- 28
-
I want to mirrior only my app content, not outside it. But only mirrior my apps whole screen. not any specifc view. Like mirroring a finance management app on my TV screen. – Avijeet Jan 06 '17 at 08:59
-
As was said, the only available APIs for developers is the one provided by Remote Display; read about that to see what you can or cannot do. – Ali Naddaf Jan 06 '17 at 15:35
-
What I found till now - Though google does screen mirroring through its google home app on both IOS and android, Cast SDK doesn't provide mirroring capabilitie API for developers. – Avijeet Jan 16 '17 at 07:28
-
So any reason why google is not providing screen mirrorring API ? – Avijeet Jan 19 '17 at 06:43
-
We provide mirroring capabilities and APIs within your app to mirror your own app to the Cast device, through the remote display apis. For system wide mirroring, user needs to enable that manually. As far as each individual app is concerned, the mirroring within the app is all they should be using. – Ali Naddaf Jan 19 '17 at 07:47
-
@Ali Naddaf, Avijeet, anyone knows about an update on remote display API in iOS to mirror the app screen(not playing video, I want app screen to be displayed only to TV)? – Jamshed Alam May 20 '21 at 03:25
-
Related : https://github.com/googlecast/CastHelloVideo-ios/issues/17 – Jamshed Alam May 20 '21 at 03:41
-
@AliNaddaf as the remote display API is deprecated which was used to support app screen mirroring, what other option does a developer now have to support screen mirroring? – hardik9850 Sep 27 '22 at 11:14