OnScreenClock v0.7.3

A small update adding an option to show the am/pm suffix when enabling the 12-hour clock.

Here is the changelog since last blog post:

v0.7.3 2023-03-31
+ added am/pm suffix option

v0.7.2 2022-10-30
* migrate to billing v4 api

v0.7.1 2022-10-07
* fix untrusted touch blocking on android 12 and up

CoinGeek News 0.2.5

CoinGeek News is a very simple app to read the CoinGeek news in a more structured way (i.e. chronologically). The goal is to add some features like favorites, filtering on metadata, etc. The app has been in open beta since June 2021, and I had the intention to release to production only when some more value had been added. However, since I’ve already been using myself for more than 2 years now, I guess it could be useful for some other people too..

The past few weeks, I’ve been cleaning up the app and making it Play store compliant (both technical and privacy wise) so today, I can finally publish to production. 🥳

Current features under development are favorites and post tags.

0.2.5 - 2023-01-21
* url launcher fix

0.2.4 - 2023-01-20
* clear cache: ask confirmation
* try to fix elusive crash on startup

0.2.3 - 2023-01-19
* mark all as read: ask confirmation
* improve settings section visuals
+ settings show database stats

0.2.2 - 2023-01-18
* gdpr compliant
* flutter3 upgrade
App screenshot
App screenshot

new app: Coingeek News

The Coingeek news site is my favorite source for blockchain news. I discovered it a few years ago but didn’t really visit regularly back then. I read the occasional shared post on twitter or one that popped into my google now feed. If I didn’t have time right away to read an article that peaked my interest, I visited the site some time later to catch up. However, most of the time, it turns out I had a really hard time finding back that article. On the site there is nowhere a timeline with the latest articles in a chronological order. Also, not all articles get posted on social media, or even if they’re posted, I might not notice them (I don’t feel like reading crypto twitter every day 🙄). So although I like the coingeek website, for me it’s not very practical. But hey, no big deal, I hear you say? you can’t read everything..?

I agree, until last year 🙂 During Coingeek Conference days, there are so many exciting announcements, you don’t want to miss any article! So for the last conference in October 2020 I quickly mashed together a prototype app so I could follow the news. It’s a very basic app right now and it doesn’t do much, but since I use it almost every day, I thought someone else might find it already useful too..

app screenshot

I do have some ideas to enhance it: favoriting, search (online/offline), post preview, filter using tags, …

The next coingeek conference is happening next week June 8 to 10 in Zurich, but also completely accessible online! So, without further ado, I’m releasing an open beta of the app as I speak. It is a cross-platform app written in flutter, but only available for android (for now?).

Join the beta from Android.
Join the beta from the web.

Enjoy the conference!

OnScreenClock v0.7.0

Soooo.. it’s been a while and although a lot of work was put into this new release, from an end-user point of view, this is merely just another “maintenance release”.

What happened?

You may know it is not easy to build apps that display stuff on top of everything, even if it is for a good reason. I tried to fix it, work around it, but I officially give up. Google is not bringing back the overlay permission. Nevertheless, using developer tools it is still possible, albeit totally user unfriendly. In theory, there is still another loop hole left, using accessibility features, but it’s only a matter of time before your app gets delisted.

Which segued nicely to the next cause of delay: the app got delisted because google does not like me linking to a donation page from the app. You would think removing this link is a small change. Android development is a moving target, so no, nothing is “simple”. 😉 Releasing a new version often requires updating other parts of the app because of google increasing the minimum android version constraint. In this case, there were so many changes (also in ads, support libs, etc), even for a little app, it was a nightmare. Anyway, after a few beta releases, it got sorted out.

In the meanwhile, I was trying to fix the overlay permission problem: my strategy ranged from asking nice to google, to implementing workarounds, to creating a companion app, to decompiling other apps.. Today, I decided I have to accept there is no acceptable solution and just provide technical documentation on how to give the permission using a developer tool which, by definition, is user unfriendly. It is a sad solution, but better than nothing! Apologies for taking 3 years to come to this conclusion. 🙂

The documentation link will show up as a QR code when you encounter the permission problem. You can also open it from within the app. Later on I hope to have an instruction video. Lastly, for rooted devices, you can simply press the button and it solves the problem magically. 😉

What’s next?

Over the years, I collected quite some feature request. More recently, it seems TCL has released some TV sets which do not properly redraw the clock. It seems to be a bug but I will see what I can do there. I provided a tweak flag in the settings to try out certain workarounds. Let the experimenting begin! 😉

v0.7.0 2021-01-29
+ overlay permission: QR code to guide on how to grant the permission
+ overlay permission: on rooted devices you can now grant the permission with the simple press of a button
* preview color before accepting
* fix crash opening website on TV device that does not advertise itself as TV
* fix crash on some devices when moving/resizing the clock
* changing 12/24 hour format, notify state change no longer requires clockview recreation
* cleanup pref change code and prevent clockview NPE
* workaround pref: TCL devices
* admob upgrade
+ firebase analytics (can be disabled)
* bumped min SDK level to 17 (Jelly Bean 4.2.x)
* target android sdk 30

Klara Live for Android TV

Do you recognize this feeling:

technology is there to help you, and in theory it can do lots of cool stuff to make your life more comfortable, yet it only seems to cause more frustation.

Yesterday I felt exactly in this spot 🙂 Let me paint some context.

A few years ago I moved into a new place and didn’t immediately find a spot for my radio. I bought this radio when I was 14 years old with just about all my savings. You have to imagine: a cool radio in that era had to be bulky and excessive wrt tweaking nobs and bass sounds etc. Problem with this is that it consumes quite some valuable living room space. Even more, in the last few years I didn’t often listen anymore to air-broadcasted radio. Nowadays it’s all about on-demand internet streaming, right? 😉 But I also listened less and less to radio channels in general. There is one exception though: I turned into a loyal Klara listener. (Tastes can change!) You can hardly call it a “classical” radio station though 😉 There’s no screaming at you or ads interrupting every 10 mins.. Very peaceful indeed. Anyway..

Without a physical radio in my living room, the ideal workflow to start listening is as follows:

  • Open radio app on my tablet
  • Cast to TV

However, the real-world workflow is more like this:

  • Turn on my android tablet. Wait up until 1 minute until it has “warmed up”. This has everything to do with Android becoming so bloated Google had to introduce the Doze feature which basically makes your device useless unless under active use (read that again 😉 ). This guy summarizes the Doze matter quite nicely.
  • Open my radio app (good app unless you use Android Pie)
  • Wait for the ad to materialize, otherwise playback stops. Same goes for syncing of mail accounts which kicks off due to awesome Doze feature.
  • Open the desired radio channel and press play button
  • Wait for the stream to start playing.
  • Google cast the stream to my Android TV (Nexus Player connected to “regular” smart tv)
  • Wait for my tv to automatically turn on using HDMI CEC.
  • Check whether the android TV responds to the cast call. Several possibilities here:
    • the TV fails to turn on -> turn on manually
    • the TV turned on but forgot why (cast does not start)
  • Realize it is broken again, and cast again from the tablet.
  • You see it’s working now and starting doing other stuff, only to realize a few minutes that the stream stopped! This can be anything: from the tablet sync somehow interfering in the playback on the TV to internet connection problems to the TV restarting services (but not resuming) because it deems it needs more memory.

Although my television has sub par sound quality, it highly exceeds the fidelity of my tablet or phone. 😉 It does however consume quite some power: ~120W (off the top of my head). Luckily I can fix this with a few extra button presses. So the final steps in the workflow are:

  • use TV remote to open menu (where you can configure brightness etc)
  • go into first menu “Picture”
  • navigate to bottom of list (luckily you can go up to end up at the bottom)
  • select “Picture off” and press OK

Only consumes about 20W then, which seems acceptable to me.

Conclusion: while listening to the radio should be only a few clicks/touches away, it literally takes minutes to set up.

Mind you, this is only turning on, not turning off! You might think: is that even a thing? You just “turn it off”? That would be to easy in today’s technologically advanced world!

Option 1: turn off the TV. Simple right? Problem is that does not stop the audio stream. Since I still live in a country where bandwidth is not unlimited, this is not an option.

Option 2: use android tv remote to exit cast (press home button a few times), then turn off TV. Problem is: sometimes the tablet will think the TV temporarily went missing and will start the cast again. (without you knowing, because you turned off the TV 😉 )

Option 3: the solution is to disconnect the cast on the tablet (sometimes it lost connection to the TV by itself) and then proceed with option 2. To be fair: successfully disconnecting the cast should stop the cast on the receiver (TV) too, so it saves time in option 2. However, disconnecting is cumbersome, it is not the same as simply pressing the stop icon in the notification (which merely pauses the cast on the receiving device)!

Anyway, this is a (quite elaborate) rant on why casting sucks. I feel sorry for ranting so much but after all, it is the tag line of this blog! 😛 So now, let’s cut to the chase!

Yesterday morning (when you don’t have much time), I was exactly in that spot again and decided to do something about it. First I checked my app updates (android TV updates when it feels like updating). Lo and behold: there was a google cast update! For a minute there, I had hope. I installed the update and checked: nah, although the changelog told me “bugs were fixed”, of course, not this bug. 😉

Reducing the number of dependencies seems the obvious solution: the less components are involved, the less can go wrong! In this case a native Android TV radio app could ease the pain but neither general radio apps nor specific Klara apps are available. In a peak moment of frustration I thought to myself: I will create an app this evening myself! Of course I’ve had this thought before, but anyone who has created an app knows that the effort can highly exceed the enjoyment, especially when you decide to share your app with the rest of the world because you feel any good compassionate person would do that.

But this app seemed so simple I thought: it can’t go wrong. 😉 In any case, I’ll keep it to myself until I feel it can more or less defend itself against the judgemental tsunami the internet can be.

Though, without further ado, here is a small demo.

It’s so basic I almost feel embarressed about it. 😉

The plan is to make a fast minimalistic app:

  • Only live stream (+ continuo maybe later)
  • Only foreground. You can stop playback by exiting the app.
  • Temporary pause (for a few seconds): answer a phone call and resume the radio where you left off
  • Maybe: show current song metadata

K.I.S.S ftw!

OnscreenClock v0.5.0k and ADBoverEthernet v0.8.6

a few weeks ago, ADBoverEthernet was removed from the Google Play store due to a payments policy violation. As you may know, only Google is allowed to make profit off your app, so you may not provide alternative ways of payment within the app. Since my app only provides Google’s In-App payment and still got removed, apparently it’s also not allowed to even mention other possibilities. I removed the mention of my paypal and link to my donation page on this blog. So everything should be good now. 🙂 I also updated the OnScreenClock app as it shares the donation code with ADBoverEthernet.

It took me a few iterations to get the new apps released as Google forces you to upgrade the target sdk to at least 26 (= Oreo) these days. With this upgrade comes extra limitations on background processes. ADBoverEthernet used a service to launch shell commands. I changed that to use the new WorkManager api.


ADB over ethernet v0.8.6 2019-04-24

  • show app version
  • make output window scrollable (in case of exceptions)
  • fix NPE crash when back button is pressed before webview is fully loaded
  • fix crash opening website on TV device that does not advertise itself as TV
  • store compliance
  • fix NPE’s when user revokes overlay permission while configuring the clock

OnScreenClock v0.5.0k 2019-04-18

  • trying to fix overlay permission trouble
  • bumped min sdk version from 15 -> 16
  • bumped target sdk version from 23 -> 26
  • fix crash on Android Oreo and higher when launching clock service at boot time
  • fix NPE’s when user revokes overlay permission while configuring the clock
  • fix admob crash

OnScreenClock: permission problem

Several users have brought to my attention that the clock app no longer works after a device factory reset due to a permission problem. The dreaded message appears:

Unfortunately, your device’s rom does not support a user interface for granting the overlay permission :/

These are my findings so far:

Not brand or model specific problem
When I received the first report, I uninstalled the app on my Nexus Player (Oreo) and reinstalled it and guess what: same problem. In the meantime I received reports on Sony TV and Nvidia Shield TV.

Android TV Marshmallow and higher
Yes, all trouble started with Marshmallow. 😉 I received reports on Nougat and Oreo and tested the app also on a Nexus 7 tablet (KitKat) and Pie phone. Unsurprisingly on KitKat no problem since no permissions exist yet, on Pie my phone showed a permission dialog to grant the permission (which is good, but still abnormal).

Unfortunately, I have not encountered an Android TV rom yet which provides a user interface for granting the overlay permission (it’s not in stock android TV and none of the vendors seem to care).

Fresh installs
All reports were due to device resets, but as I already pointed out: simply uninstalling and reinstalling the clock app will exhibit the problem. Updating the app is no problem since it will preserve the previously granted permission. By taking advantage of this, I can test out a fix without impacting existing users.


I did a quick search on the interwebs but no luck so far, it’s kind of a niche topic after all. 😉 I suspect a google Play Services or Play store update is the culprit but didn’t find any news yet. If it’s part of a security fix, information will be sparse anyhow.

I see several options:

  • google did a small fuckup in the play services or store (as they did with the remote not responding, deep sleeping) and might fix it (can take several months)
  • google intentionally changed the way the overlay permission is granted (and no longer wants to grant it automagically)
  • the permission not being granted anymore might be a side effect of some other policy change

Overlay permissions have always been tricky on android (tv), so let’s hope there is a solution possible.. (or a hack at least)

Quick KDE KWin hack: Ignore global shortcuts except alt-tab

From time to time a pet peeve can reach a critical level of annoyance at which it starts to irritate. You google it, hoping to find a solution or at least some allies, but if none turns up and you’re out of time, you simply give up and hope a solution will magically manifest itself one other day. But what if that day never comes? Luckily for us, open source enthousiasts, we can do something about it ourselves 🙂


I’m quite an avid shortcut user. Linux/KDE is an environment where this type of user feels right at home. Not only do most actions in a software have a shortcut, you can also define lots of system-wide or global shortcuts. Kwin, KDE’s window manager defines quite a few out of the box.


This is all fine and dandy until you want to use this cross-platform software which you got used to in a different environment (i.e. windows at work) and you want to start using it at home. When the application is not (KDE) shortcut friendly or you are so used to the windows keymap that it’s a pain to learn a new scheme, you start to feel frustrated. Learning a new shortcut scheme seems the best solution but this doesn’t work well when you have to maintain 2 shortcut schemes in your head, depending on your environment (home vs work, your computer at work versus a colleague’s computer).

A typical example here would be some IDE, for example Intellij IDEA. Although the IDE does provide a KDE keymap by now, I started using it ages ago when there simply was no alternative keymap (nor a community edition or even official linux version, I guess). Also, I used linux only occasionally back then. These shortcuts are hard-wired by now and it is already hard enough to keep in mind whether I’m using Intellij or Visual Studio.

Another possibility is that the application really needs that much shortcuts that it just can’t bother with the shortcuts which may or may not be defined by the environment or workspace. One example of such complex application is Blender. Try it out and you’ll see what I mean. 😉

KDE, being the configurable desktop environment, does offer some configuration settings. For each window, Kwin allows you to define rules which match certain windows / applications which creates a config. Using this config, you can configure special window attributes. One setting is to block all global shortcuts.

This allows you to use your favorite application with its favorite native shortcuts. Of course, most people use more than 1 application at the same time. However, since all global shortcuts are blocked, the alt+tab shortcut to switch windows is blocked too. Alt+tab is not a special shortcut to KDE, it simply is a shortcut that happens to be assigned globally to the “Walk through windows” action exposed by the KWin component to the System Settings. Lacking any window switching shortcut, you adapt and start using the mouse to switch applications. There are times you cope just fine. But there are other times it is just one thing too much that annoys you. 🙂


So how to fix this? Just like any other problem you have with an open source application: fetch the source, fix and build! 😉

Since I just wanted a quick fix (I thought, let’s check this out for 30 mins, which turned out to be a lot longer of course), I chose to patch the behavior of the “Ignore global shortcuts” setting to exclude the Alt+Tab shortcut (more precisely, the shortcut currently assigned to the “Walk through windows” action). I briefly investigated KWin’s scripting abilities but it turns out the required functionality is not exposed.

I will now document the process, which took place on opensuse leap 42.3. You may want to tune out now if you don’t care about the gritty tech details. 😉

Where is the source?

I thought it had to be kwin, right? So I checked out the source from github and started searching for “Ignore global shortcuts”. It turned out to just call something in kglobalaccel which is not part of kwin.

Getting my hands dirty, I first fired up a VM I had lying around in order not to f*ck up my currently running system. Next I installed Qt Creator to easily navigate the code. Also, never forget you have to checkout the tag for the version you are currently running! (can be a treasure hunt by itself)

Browsing the source, I finally find a possible tweaking point in the src/runtime/component.cpp -> deactivateShortcuts method. It disables all shortcuts when a window is entered which has a “Ignore global shortcuts” rule. So I simply added an exclusion for the “switch windows” action.

Building a patched rpm

Time to try it out! In order to build it, you will need to install its dependencies. On an rpm based system, the easiest way to go forward is to do a “sourceinstall” of the rpm in case. For that, we first have to know which rpm contains the affected shared object (.so file).

You can take different routes to pin point the rpm. I checked the CMakeLists.txt to see what the output targets were. When you build, you can also see the class pass by and check into which library it gets linked into. Using that .so file, you can find the rpm using “rpm -qf <.so>”

An alternative way would be to find a kde related rpm matching “global” and then checking its contents (using “rpm -q –filesbypkg <rpm>”) for the .so file.

Once you know the rpm, you can easily install all required build dependencies by issueing a zypper sourceinstall command: “zypper si <rpm>”

The hard part: logging

I wanted to add some debug output to see if I was looking at the right place in the source base and how frequently the code got called. Now things got messy. You’d think patching the code was the hard part, guess what.. 😉

I had played with logging before in KDE, but of course things have changed with KDE 5. Nowadays, KDE uses Qt’s default logging mechanism. It meant figuring out the logging category used by kglobalaccel and finding a way to activate it. The logging category was nicely tucked away in logging_p.h: “kglobalaccel-runtime”. Activating it seemed to be trickier. According to the Qt documentation, you can alter the log level through an env var QT_LOGGING_RULES. Since I was adapting a core component, I needed to set the env var before logging in. On opensuse you can create a file /etc/profile.local which gets sourced by /etc/profile.

I added the env var and it seemed to work (=showed up), unfortunately still no logging. More precisely, nothing showed up in ~/.xsession-errors-:0. I started adding log statements all over the place, analysing the .so file to check whether my modified method was actually included in it (readelf -Ws libKF5GlobalAccelPrivate.so.5.32.0  | grep deactivate), etc.. Until I realised I didn’t check the journal (journalctl -b -0) yet, there it was. 🙂 Bonus points: the code change had its intended effect!

End result

So there I had it, a working patch WITH logging ⇒ pure SATISFACTION 🙂

Feel free to share this satisfaction by downloading the .so and installing it in /usr/lib64 (use at own risk). I’ve been using it for 2 months now without problems. It’s a good hack until a more fundamental solution is in place. First steps have been taken! 😉