java – Is it possible to send HDMI CEC commands from an Android Device.-ThrowExceptions

Exception or error:

I have an MK809 and would like to send an HDMI CEC command to turn on/off the TV that the device is connected to. Is there a way or library to send CEC command as I can’t see anything documented anywhere?

How to solve:

“HDMI-CEC is a one-wire bidirectional serial bus that uses the industry-standard protocol to perform remote control functions. CEC wiring is mandatory, although implementation of CEC in a product is optional. It was defined in HDMI Specification 1.0 and updated in HDMI 1.2, HDMI 1.2a and HDMI 1.3a (the last added timer and audio commands to the bus). USB to CEC Adapters exist that allow a computer to control CEC-enabled devices.”

Assuming MK809 follows HDMI specification, it should possible from a hardware point of view. However, the issue lies in the software. I was unable to find a Java library for CEC commands during my cursory search, although I was able to find some for C and even Arduino.

Questions to ask:

  1. Does your device support CEC? Does the OS current support it with its driver?
  2. Does your hardware support it? (It does if it follows HDMI specification)
  3. Does your TV(s) support CEC? Will it actually turn off when it receives the command or just ignore it?

P.S.: Congrats, your question is the first I’ve answered since joining this website. 😀

Update as of 2016: Android Lolipop does support new HDMI controls in the OS as the Android source code shows. The API documentation can be found here. Keep in mind it is still up the device manufacturer to actually support the API in the device drivers. Also, most TVs do now support CEC commands, but they are often not enabled by default.

Leave a Reply

Your email address will not be published. Required fields are marked *