检测HDMI端口的Android设备
我工作的一个Android开发应用程序,需要检测HDMI端口。可有一个人指导我,我怎么能检测的Andorid设备编程HDMI端口。
I am working on a Android development app that needs to detect HDMI Port. Can some one guide me how can i detect HDMI port in andorid device programatically.
在此先感谢
您可以尝试收听广播隐藏Android的意图
You could try to listen to the broadcast hidden android intent
"android.intent.action.HDMI_PLUGGED"
如果您使用的Android 4.0或更高版本,或者如果您使用的索尼设备:
if you use android 4.0 or higher or if you use Sony device:
"com.sonyericsson.intent.action.HDMI_EVENT"
检查本教程的详细信息:的http://developer.sonymobile.com/2012/05/29/how-to-use-the-hidden-hdmi-api-tutorial/
Check this tutorial for more information: http://developer.sonymobile.com/2012/05/29/how-to-use-the-hidden-hdmi-api-tutorial/
也有第三方的libraires像KernelSwitchObserverLib http://forum.xda-developers.com/showthread.php?t=1963785
There are also 3rd party libraires like KernelSwitchObserverLib http://forum.xda-developers.com/showthread.php?t=1963785