How to check the HDMI device connection status in Android?
I came up with this using the other answers and some from elsewhere: /** * Checks device switch files to see if an HDMI device/MHL device is plugged in, returning true if so. */ private boolean isHdmiSwitchSet() { // The file ‘/sys/devices/virtual/switch/hdmi/state’ holds an int — if it’s 1 then an HDMI device is connected. … Read more