Context
You can skip this section if you just want the solution
From Android Marshmallow on, apps need to ask permission to the user for performing certain tasks, e.g. accessing contacts, or in our case: showing something on top of all other apps. Showing things on top, aka the overlay permission or more technically SYSTEM_ALERT_WINDOW permission, is considered a dangerous permission and requires special care. However, a lot of users got confused when their phone started saying “Screen overlay detected”, and big companies like Facebook started getting tons of support requests. So to mitigate the problem Google started (from Android 6.0.1) to grant this permission automatically if the app got installed through the Google Play store.
However, starting January 2019, they gradually started excluding apps from receiving this permission automatically. My little unpopular OnScreenClock app was one of the first apps to go down. In normal Android environment (non-TV), this does not pose a real problem as the user can still grant the permission themself. Unfortunately, on Android TV, there usually is no such user interface for granting the overlay permission (which requires a special user interface in contrast to “regular” permissions).
It becomes gradually more difficult to display something on top of other things, up to the point at which it will probably become impossible. However, until then, a workaround is still possible. 🙂
Workaround
The “easy” way
Unfortunately, there is no easy way yet.. 🙂 I was going to make a companion phone app to assist in granting the permission but it does not seem so trivial.. Maybe I will create a video explaining how to execute the “techy” way. If somebody feels up to it, be my guest and I will post it here!
The “unconventional” way
If you have a rooted device, you can simply press the button within the app!
This is by far the easiest way, unfortunately, most people don’t have a rooted device.
The “hard” or techy way
For the tech savvy people, this is the recommended way. Simple type the following command:
adb shell pm grant mattiesworld.gotdns.org.onscreenclock android.permission.SYSTEM_ALERT_WINDOW
An obvious prerequisite is that you have adb command line tool installed.
Some devices, like Nvidia Shield, provide a network debug option out of the box, so you don’t even need to connect your TV with a USB cable. Just run the following command before issuing the “adb shell pm etc..” command:
adb connect <ip of your tv>
Nice
Eu quero fixa a hora na tela mas fica saÃdo o que eu posso fazer em relação a isso
Dear Maria,
I understand the clock is disappearing for you. There are 2 scenario’s:
1. every time when you turn the TV back on, the clock is gone. Some tv’s do not properly come back from sleep mode. It is possible to disable the “quick boot” option in the TV settings which will fix the problem, but it will take longer to turn on the TV.
2. the clock disappears after some days. This is something I cannot do much about currently. It is the operating system deciding to kill the clock to free resources.
In the future I hope to address these problems by rebuilding the app from scratch using another way to display the clock. Rebuilding the app takes time ..
Maybe a temporary fix can be to assign a shortcut to the OnScreenClock app, so you can quickly restart the clock.
Thanks
Muito bom
Yes
que lo que debo activar
hi Henrri, you have to make an ADB connection to your TV and run the adb command: “adb shell pm grant mattiesworld.gotdns.org.onscreenclock android.permission.SYSTEM_ALERT_WINDOW”
y como se hace esto?
la tenia instalada en una smart tv sony pero al actualizar a android 7 no me deja instarla onscreenoclock y me dice que activar ADB .he activado depuracion usb en opción del desarrollador y no se mas .
ayuda y gracias
Hi Rafa, next step is to download and install ADB on your computer:
https://www.xda-developers.com/install-adb-windows-macos-linux/
and execute the adb command provided here.
Good luck!
PS: I have created a discord community so people can help each other out in the future. Unfortunately, there’s nothing there yet 😉
https://discord.gg/dBf273SJYc
C est une application jolie
Não consegui entrar
Es útil
Ist sehr gut
Good app
Love the app!
Is there a ADB command that would load clock at startup? Currently I have to open app every time I turn on tv
Hi, thanks for the feedback. Normally (when the clock is turned on), the app should start automatically on each boot . Possibly, your TV does not broadcast the BOOT_COMPLETED event. What is the model of your TV and which Android version does it run?
Ottima app
Muito obrigado
you’re welcome!
It’s a very useful app because many new smart TVs no longer have this feature.
I managed to activate OpenScreenClock on a 2015 SONY TV (by the adb … method) and on a brand new 2023 SONY TV (which allowed me to assign SYSTEM_ALERT_WINDOW permission easily).
thanks for the feedback. Are you saying the 2023 Sony TV has an option in the user interface to allow the overlay permission? Did the app open this function on itself on first startup or did you have to find it manually in the settings? If possible, maybe you could share a screenshot or photo to help other people? Anyway, it’s good to know! cheers
Xxx
Muy bueno.
Thanks for the app
It works under Sony bravia.
What else can be inserted would be super insert date
DAY MONTH YEAR
Thanks in advance
Nice
Não estou conseguindo ajustar a hora
Obrigado
Não estou conseguindo deixar o relógio fixo na tela da tv.
Please enable the clock on the screen
Please use your settings’ user interface to grant the “Draw on top” permission to OnScreenClock or if that is missing, use the ADB way described above.
Bom
Muy buena app
Top amigo
Love this unique app, here is a usecase for a standby live cam and clock combo: https://imgur.com/a/OO27GHZ
lol, thanks for sharing. that’s a very creative usage of the app! 😉 I never invested much time in the analog clock implementation as I figured no one would use it.. I was wrong!
I will keep that in mind while rebuilding the app.