4

I need some help where to look for api or code example on how to control an external screen from an Android app. My Android app will most of the time run on devices which have no built in screen, instead you connect an external screen with hdmi or dvi. I want to be able to control standby on this screen by disabling the hdmi output signal and then re-enable it again.

Its not a problem if this requires system-app privileges.

Thanks.

Robert
  • 2,357
  • 4
  • 25
  • 46
  • Ahm, I'm not sure at what you want. Basically, when you have a device, like Android Box TV it works normally like "a phone", I mean you have settings in android, that blanks the screen or turn the screen saver on. You want to override these settings or what? – Nexowski Jun 27 '14 at 15:59
  • 1
    @Nexowski The settings in Android (PowerManager) works fine when using the app on a phone (it turn of the phones display). But it does not turn of the external display. – Robert Jun 28 '14 at 14:51
  • Ok, so you want to turn off the external display along with internal? I'm not sure if it can be done, because if you have something hooked up to external display, then what's the point of turning screensaver/turning off the external screen, normally the display device takes care of that, or am I wrong? – Nexowski Jun 30 '14 at 08:09

1 Answers1

2

According to this link Can we turn on/off hdmi settings from our app programmatically

as stated by CommonsWare it looks like it isn't so easy.

Though, according to docs you should try the Presentation class from Api 17: http://developer.android.com/reference/android/app/Presentation.html

Either way, when you're connected to an external display and not sending any data/video to it, it should shutdown/sleep by itself.

Another thing, if the device you aim, has only the hdmi/dvi maybe it can be mounted as an "internal screen" like in the phone.

Community
  • 1
  • 1
Nexowski
  • 335
  • 1
  • 10
  • 1
    Youre welcome, if you can report back then it would be great to know your results, maybe someone else would also get profit from the information. – Nexowski Jun 30 '14 at 14:18
  • Yes, I will. I have also contacted the device manufacturer for guidance as recommended in that thread. – Robert Jun 30 '14 at 15:35