How can I turn the TV/display on and off from the app installed on Android box which is connected via HDMI?

428 Views Asked by At

These are my specifications:

Angular CLI: 8.1.3
Node.js    : 14.13.1
OS         : Windows 10 x64
Angular    : 8.1.3
TypeScript : 3.4.5
Webpack    : 4.39.2

Currently I'm working on a digital signage project. I have built two apps with Cordova. One for administrator control and another one needs to be installed on an android box let's say it's a client app.

The administrator will be able to create content, upload videos and photos. And the uploaded media needs to tagged with with the client app.

The client app fetches the tagged data from the server and displays on the TV...

I've managed to get above things correct. But, now I need help.

There will be configurations on the administrator app which are saved in the database and can be fetched by the client app. And also there'll be a configuration for turning the TV on and off via hdmi-cec.

I installed the app in an Android box and connected the box to the LED TV via HDMI. I need to send a turn off signal to the TV (the Android Box stays on. Only the TV will be turned off) when the user clicks the turn off button. And the TV needs to be turned on when the user clicks to turn the on button.

Is there a way to turn the TV/display on and off from the app installed on the Android box which is connected via HDMI?

1

There are 1 best solutions below

0
On

As far as I know, this is not possible in the regular Android Tv Box API. Some tv's do have a non-public REST API or other APIs that they provide to certain manufacturers on demand. These are mostly used by apps to turn on or off the TV itself.

However, you can try turning the brightness to 0% to imitate it being turned off. Also, you can try using a power manager and wake locks if they are available on the Android Tv Box API.