检测Android设备中的HDMI端口

use*_*512 5 android hdmi

我正在开发一款需要检测HDMI端口的Android开发应用.有人可以指导我如何以编程方式检测andorid设备中的HDMI端口.

提前致谢

Mar*_* S. 5

你可以试着听广播隐藏的android意图

"android.intent.action.HDMI_PLUGGED"
Run Code Online (Sandbox Code Playgroud)

如果你使用Android 4.0或更高版本或使用索尼设备:

"com.sonyericsson.intent.action.HDMI_EVENT"
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请查看本教程:http://developer.sonymobile.com/2012/05/29/how-to-use-the-hidden-hdmi-api-tutorial/

还有第三方图书馆,如KernelSwitchObserverLib http://forum.xda-developers.com/showthread.php?t=1963785