I have just bought a new Chromecast with Google TV and hooked it up to my A/V-Receiver+Beamer setup, but I will refer to it as "TV" further on as it doesn't make a difference here.

According to Android Police - How to control Chromecast with Google TV volume using your phone, there are three options:

  1. TV volume is controlled via HDMI CEC using the Chromecast remote
  2. TV volume is controlled via Infrared using the Chromecast remote
  3. Chromecast volume is controlled via the Chromecast remote

I can't combine those options.

Options 1) and 2) mean I can't use my phone or Google Assistant to change the volume of what I'm playing. Option 3) means I will lose support for 5.1 surround sound, so this is an option I do not want to use in my home cinema setup.

So apparently, I'm out of luck end of the story.


In the Google Home app, I can open my Chromecast and open a remote on my phone and it has volume buttons, with which I could control the volume of my TV (as if I would have pressed the buttons on my Chromecast remote), if I chose option 1) above.

So this is proof that it is indeed possible to control the volume directly from my phone AND have support for 5.1 sound. It's just hidden underneath a lot of clicking around.

I'm not new to programming at all, I have worked as a Java developer in the past for almost a decade), but I'm completely new to Android development.

I want to figure out how feasible it is to write an app which essentially does the following:

The app is in the background, no user interface is visible. It hijacks the physical volume controls of the phone (this is doable at least when you're within an app (aCalendar does this and allows you to scroll with those buttons). It determines whether media is currently streamed to a Google Cast device (which seems to be doable as well), determines whether that device being cast to supports volume control (or determines whether the device is a Chromecast with Google TV, and ends up with the same result) and if yes, it sends a volume up/down event to that Chromecast.

If not, the app just forwards the event to Android and it behaves as normal (e.g. by changing the phone's internal volume, changing the in-call volume, etc.).

More specific questions:

  1. Is it possible to intercept volume-button presses in an app which runs in the background (please excuse me if I'm not using correct Android terminology heere)?
  2. Is it possible to forward intercepted volume button presses to the OS, so that the default behavior of those buttons doesn't break?
  3. Is it possible to determine whether media is being streamed to a cast device?
  4. Is it possible to determine whether that device is supporting volume controlling or alternatively determine what model of Chromecast it is?
  5. Is it possible to send volume events or remote-key presses to that device, like the Google Home app does?

I know, the question is rather long, but the topic is quite complex on the other hand.

  • Welcome to Android Enthusiasts Stack Exchange. Please note that app development is off-topic since Android Enthusiasts focuses on end-users and power users (who are not necessarily developers) solving their issues. Thus, while this community might explain the technicality of Android OS to your queries, coding solutions are out of the scope of this community. For programming questions, you might want to try our sister site Stack Overflow.
    – Andrew T.
    Dec 1, 2022 at 3:36
  • Not sure if possible for a non-rooted device as it sounds like you are trying to do tapjacking. Since you have an A/V setup you may wish to read the OEM docs on Android TV - HDMI-CEC Dec 1, 2022 at 5:15


You must log in to answer this question.

Browse other questions tagged .