Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect HDMI Port in android device

Tags:

android

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.

Thanks in Advance

like image 551
user1814512 Avatar asked Nov 17 '12 13:11

user1814512


People also ask

How do I enable HDMI on Android?

The simplest option is a USB-C to HDMI adapter(Opens in a new window). If your phone has a USB-C port, you can plug this adapter in to your phone, plug an HDMI cable in to the adapter, and then connect the cable to the TV. Your phone will need to support HDMI Alt Mode, which allows mobile devices to output video.

Why is my HDMI cable not detected?

The HDMI cable you're using might be malfunctioning or too old to perform adequately. Try a different HDMI cable to see if it solves your issue. Alternatively, you can use the first HDMI cable to connect a different video device to check if the video device is malfunctioning.


1 Answers

You could try to listen to the broadcast hidden android intent

"android.intent.action.HDMI_PLUGGED"

if you use android 4.0 or higher or if you use Sony device:

"com.sonyericsson.intent.action.HDMI_EVENT"

Check this tutorial for more information: http://developer.sonymobile.com/2012/05/29/how-to-use-the-hidden-hdmi-api-tutorial/

There are also 3rd party libraires like KernelSwitchObserverLib http://forum.xda-developers.com/showthread.php?t=1963785

like image 88
Marcin S. Avatar answered Sep 20 '22 19:09

Marcin S.