Hacker News new | ask | show | jobs
by BubuIIC 2313 days ago
Author here (of that post and the framework).

The solution to the background limitations for now is running as a foreground service. This shows a persistent notification (which can be hidden by the user) but can then run indefinitely. The other option is to integrate this at the system level (via a custom rom, root, magisk, etc.).

> I'm curious to know if anyone is using this framework in the wild.

The client side implementation of this is still WiP, so it's not used yet in the wild. I hope to be at a point where I can work with some apps on integrating it there in the next few months.

5 comments

Maintainer of Red Moon, a screen filter app, here. I've struggled with similar problems as others describe for a long time.

As far as I know, the only truly 100% reliable way to never be killed is to run as an accessibility service. I haven't implemented this in Red Moon but will likely add it as an option. I believe it has a large impact on bettery life.

You can also set alarms using AlarmManager to restart the service if it has been killed, and optionally wake up the device. This is what DNS66 does.

This might have changed since, but in 2017 LastPass had to work with Google to update how they run their app. Google introduced "a new policy restricting the use of Android Accessibility Services" [1]

I'd look into that before starting that implementation.

[1] https://blog.lastpass.com/2017/11/lastpass-android-accessibi...

I have a legitimate accessibility reason for it, to help epileptic users.

https://github.com/LibreShift/red-moon/issues/253#issuecomme...

The restriction only applies to apps on the Play Store, it could continue to be distributed on F-Droid.
I've been a happy user of Red Moon for years, thank you for building it and publishing it on F-Droid!
I love using Red Moon and really appreciate that it's on F-Droid. Thank you!
This is getting out of hand.
> but can then run indefinitely

Just bought a Xiaomi Redmi Note 7 and it kills everything including foreground services with a notification.

A simple user still can allow it but it will require some tech knowledge to follow instruction that are described here: https://www.reddit.com/r/Xiaomi/comments/amcck5/miui_10_keep...

I found the easy fix was to flash another rom. I fought against that OS for way too long.
I don't think I make a wild statement by saying that most android users don't share the same definition of "easy".
people get 'simple' and 'easy' mixed up.

If a OS is actively sabotaging you, then yes, the only real solution is to replace it with something else. That's the simple and obvious solution.

The simplest way to do this is to not buy a phone with shitty OS in the first place. As in "Don't buy a phone from Xiaomi".

And when users complain about it you tell them that the problem is their phone manufacturer. If you can, of course, give them a work around so the app will work. But eventually they'll plug all the holes that allow for a functional phone. So it may not always be a option.

> tell them that the problem is their phone manufacturer

Despite this being true many will see is as an excuse, or worse just a plain lie, and leave you a 1* (or 0* if possible) review ranting about your attitude and bad coding. How dare you criticize their choice of device?!

> found the easy fix was to flash another rom.

You don't always have that luxury.

This issue looks very similar to web devs still struggling with legacy code to support IE.

Should you simply drop support for IE and punish people relying on it and hope it dies quickly?

Or should you maintain legacy code, and actually helping IE to survive by supporting it?

I find that issue to be quite complicated and I'm still unsure if there is a right answer to that.

Have you looked at integration with microg, yet? https://microg.org/ It seems like a natural candidate wanting a replacement of GCM/FCM.
> (which can be hidden by the user)

I wish this was more obvious to people. Had to use my retire parent's phone to long into Netflix for them and it was overflowing with of persistent notifications.

look forward to get access from a cordova plugin