I am writing a Cast application for a shop that needs to perform two tasks:
- Show some ads (static images) in the background (possibly with a smooth image transition);
- Show the "We are serving" number in a corner.
I have already developed the application (both a custom receiver and an Android sender). The ads are provided by the server and therefore embedded in the receiver application, while the sender application is used to control the "We are serving" number.
Everything works like a charm, but after some minutes the sender disconnects and the receiver exits, leaving the screen with the Google Chromecast backdrop images.
While I can accept the sender disconnection (even if I would like to avoid it), the receiver app exiting is not acceptable.
I tried sending keep-alive messages through the CastSession.sendMessage(), but it didn't work.
I thought about playing some content in a hidden cast-media-player to trick it in thinking that I am playing something, but I think this is quite a dirty solution.
Is it possible to achieve what I am trying to do in a better way?