I'm quite new in using Google Cast API. I want to create a simple application where is one button to mirror the whole screen to receiver device. I want also to mirror everything outside the app(when the app is going to background). I founded examples with casting remote text and cubes and it's clear for me
I want to cast whole screen/window in and outside of application like with GoogleHomeApp. In PresentationService file I'm trying to do something like this:
Window getWindow(Activity myActivityReference) {
return myActivityReference.getWindow();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Window window = getWindow((Activity) getApplication());
setContentView(window.getDecorView());
}
PS. There are also other apps which use chromecast to mirroring like Screen Stream Mirroring Free. I'm really trying hard find out how to do this with my app. Please help me.
Thanks in advance!