Android vendors, don’t kill my app
dontkillmyapp.com
dontkillmyapp.com
We're trying to figure out the best way of telling users how to change their battery settings (which, for the avoidance of doubt, are usually on by default; and sometimes revert back to default on OS updates); some kind of annoying modal popup in the app before they begin a run, perhaps.
What can I say? These Android manufacturers are prioritising numbers they can put on a spec sheet over the end-user experience on entire categories of legitimate fitness and audio apps. We have no recourse and no way to get on their whitelist. Maybe Google could threaten the manufacturers, but that would be a nuclear-level response.
Yet another thing third-party app developers have to deal with.
The best way to do that is to remotely figure out on which devices the app is getting killed by sending data push notification messages and an in-app ack mechanism. And then show users an annoying popup message the next time they launch to make sure that they whitelist the app. We faced the same problem while building Flock, a team messenger and the details are outlined here.
https://hackernoon.com/notifications-in-android-are-horribly...
Background services management was let loose in Android till 6.0; with doze mode & Job scheduler it has vastly improved. I think manufacturers shouldn't start killing apps themselves, as shaming apps which abuse background services, eat power inconsistently by displaying notification & allowing user to 'force stop' the app themselves does the job as in OxygenOS.
For all the flak iOS gets regarding multitasking, I was impressed by their uncompromising attitude towards background services from the start, even when I was bashing my head during iOS development to implement features on par with android version. The background operations should be completed within 3 minutes, but there's no guarantee that it will not be killed before that!
That seems to be exactly what TFA notes in various per-manufacturer segments (the color blocks with poop emoji are clickable and provide manufacturer-specific information and complaints) e.g. for Nokia:
> every [background] process gets killed after 20 minutes regardless it is actually supposed to be running and doing a useful job for the user.
or for OnePlus:
> Not only did users need to enable extra settings to make their apps work properly, but those settings even get reset with firmware update so that apps break again and users are required to re-enable those settings on a regular basis. […] On some OnePlus phones there is also a thing called App Auto-Launch which essentially prevents apps from working in the background.
Then on the next boot explain that you detected this, and guide the user to OP's page? Or is it way more complicated than so?
> This app kills apps in the most brutal way we have seen so far among Android vendors.
You can't detect that your application was kill -9'd. I don't think you can detect that "PowerSavingAppG3" is running either (I'd guess it's running as root and you're not), so you can't even infer from its existence that your application will be traumatically killed in short order.
Both would show a last good status and no good exit.
1. Create an empty file when the application launches
2. When the application terminates, write the reason for termination into the file.
3. When the app launches again, read the file. If it was empty, then you were SIGKILL'd, or you crashed.
"Might have been killed, might have crashed" is not helpful, and the inability to know is the very issue at hand here. You can't know whether your application crashed, the user forcefully killed it or you fell afoul a background killer. What now, do you start spamming the user anyway?
You might be able to write the word "bad" in a file, and then clear the file if your app closes nicely. If you start and find the word "bad" in the file, then you know you were killed. A slight variation of what you suggested.
Details outlined here : hackernoon.com/notifications-in-android-are-horribly-broken-b8dbec63f48a
The point is that this is entirely Google's fault and yet it's the devs who have to clear up the mess and take the blame, or alternatively we bombard the users with technical fixes and explanations. Quite clearly neither of these options is where we should be with a mature OS on a mass consumer device.
Now I'm getting all angry again just thinking about it. Time to up my meds.
The third party controlling your user's experience is forcibly killing your application while it's in use as intended. This somehow means you are misunderstanding UX?
People are suggesting ways to detect it and teach the user how to stop it, because they have no automated solution to this problem.
What misunderstanding would that be exactly? App developer has to find a way to help customers work around an issue they cannot resolve themselves. Seems reasonable to me.
Pulling the nuclear option for something with clear workarounds (or which only impacts peripheral features) is unacceptable.
Eg. Blocking legit services and obscure errors popping up.
Ps. Love zombies run
Apple took a lot of flak for not having multitasking, but to they credit they took the time to build explicit APIs that allowed apps to handoff certain whitelisted tasks (audio playback, downloads, alarms, notifications) to the OS, and made clear guarantees about the circumstances under which the APIs would work.
iOS's support for background tasks is still shit. This is why some apps have been abusing the location API to ensure that background tasks don't get killed. Apple deserved all the flak it got and it still does.
_Example 1:_ fetch email (without push) for any non-Apple email app will not work reliably, because the app can get killed. You have to rely on Apple's built-in notification support, but this means that a server-side connection needs to be maintained.
As a result, if you want reliable mail delivery without using Apple's Mail, you have no way but to share your username and password with third-party app servers which you don't trust. For example: Airmail or Canary Mail.
Of course, Apple's own Mail has no such restrictions because it is a special part of the OS. This is no surprise however, since Apple has been actively hostile to alternatives for their own apps.
_Example 2:_ backing up photos and videos (with Dropbox, Google Drive, etc).
There's no way to ensure that your photos get backed up without making an effort to keep the app active, in the foreground, with the screen on, or without the app developer abusing the location API, which Dropbox has been doing.
Example 2 should work fine with the background mode declared [2]
Both these APIs are pretty old... is there something I'm missing?
[1] https://developer.apple.com/documentation/uikit/core_app/man...
[2] https://developer.apple.com/documentation/foundation/url_loa...
2. no, it does not work for background uploads, here are screenshots of Dropbox's configuration and Dropbox is not alone in doing this ;-)
Step 1: https://www.dropbox.com/s/b7vylhljg2fwtb8/2019-01-14%2015.02...
Step 2: https://www.dropbox.com/s/c9knz2zz6zs28l5/2019-01-14%2015.04...
It's just a hard problem. App developers are bad, and do bad things. OSes can't protect against all bad behavior. Phone manufacturers do have a vested interest in protecting their users from bad apps. Users do actually benefit from this on balance.
By dumbing things down that way Google created this situation IMO, it's bad from a quality, usability and privacy perspective. Of course Google considers that you leaking your personal info is a feature so that part probably won't change, but they should at least care about the two other points.
What I, the owner of my device, have directed them to do.
Apple's approach makes easy things difficult (because one must use their APIs) and difficult things impossible (because Apple have decided that purchasers of their devices shouldn't be permitted to do things Apple wishes them not to do).
I want a general-purpose computer that I own & control in my pocket, not some stripped-down communicator owned & control by someone else.
I don't think this is true in the later releases is it? I get a lot more ad-hoc permission requests these days, and there's much more control in the application settings (the android app settings, not the settings the app presents).
The Play Store has no requirement that apps degrade gracefully when permissions are denied. So the result is usually the same as pre-Marshmellow. You just get more annoying popups.
I miss Cyanogenmod where I could deny a permission (e.g. contacts) and the app would have no idea it was denied (it would receive an empty list of contacts).
All android phones I've owned had this option.
But for multitasking there isn’t really any fine grained permissions - as long as the app is doing a whitelisted task in the background, no user permission is required. I think Apple does check that background APIs are not misused as part of the review process, though - I don’t think you could implement a tracking socket masquerading as a background download, for instace.
Very often on iOS when you see a notification 'from an app' or something in the background is completed 'by an app', in fact the app didn't do any of it. This means fine grained permissions for background processing aren't really an issue on iOS, because such behavior is managed and guaranteed by Apple. It only matters when there's a security or privacy implication.
This is why background activities came so much later to iOS, because Apple had to very carefully think through and implement all the background services apps would require in an efficient and secure way.
EDIT: To be clear there are some exceptions but I'm not sure exactly what they are.
But, if I recall correctly, VLC will continue a background file transfer session from its built in web server on iOS if you play a movie in the background. Otherwise it will be killed after 10 minutes.
The Facebook app used to play a silent audio track to stay active in the background, until they got called out: https://www.reddit.com/r/iphone/comments/3opxhm/facebook_app...
As a developer myself, it is just annoying do deal with and just not scalable if you have to explain each user individually how to turn of these "optimizations" (if that's even possible).
My problem with that is that it kills all innovation and creativity - only the OS vendor can come up with a "new" whitelisted activity. Anybody else is out of luck. Inevitably that means you simply can't get niche applications because what Google or Apple sized company is going to invest in something only 10,000 people might use? I might be idealistic, but I firmly believe that it's possible to both grant power to end users (as in, enable app developers to have a very large amount of control) AND deliver a good end user experience. It requires a lot of good design and discipline and it's definitely hard, but that's not an excuse to give up and hand over all control to the OS vendor.
It is not the API, it is not threading capabilities. Just shitty and locked environments. So define as many additional rules as you like. Won't change much.
They would find a way, because money.
And no, the trash app I am talking about exists to prey on unaware users by being an obvious fake or by extracting information about location, contacts and configuration.
"Managed" platforms accelerated this phenomenon in my opinion.
I think about 1/3 of all our support requests are about the app being killed in the background on specific phones. The part of the app that does the actual scheduling of the alarms is a big mess with lots of device & API level exceptions. Debugging alarm problems is a nightmare.
We often advice users on what phone to buy and tell them to avoid specific brands. Sometimes users even need to buy a new phone to be able to have reliable alarm signals.
I understand why manufactures are doing this. But it really degrades the user experiences for our users quite a bit and is a significant cost (in terms of support load + extra development) for us as an app vendor.
Really hope that Android 8+ incentive manufactures to just use the standard Android mechanisms: they seems to work quite well in my experience. You can run things in the background, but only if it has a user interaction as a result: i.e an alarm notification. The user can then determine if this is wanted or not directly from the notification itself.
Unfortunately it is not much better on the Apple side of things with local push notifications limits.
I really don't. User has power to uninstall or replace app that is in his opinion using too much power. There is no need for manufacturers to intervene. They should only display warning about app using too much power. But it seems killing app is so much easier for them.
If Samsung kills the apps, the app maker gets a bad review. If Samsung doesn't kill the apps, Samsung gets a bad review. I know which one I would pick if I was Samsung. At that point it's up to the user to decide if that choice is something they want to subscribe to.
that's why I mentioned, they could display some notification when app is using battery heavily (similar to ANR).
>The majority of people don't know how or even want to be an administrator on their phone.
Exactly same thinking as those device manufacturers. user = idiot (let's kill apps for him, what could go wrong, right?) This kind of thinking brought us here.
However, the implementations of the API are questionable.
Some calls to that API on some OEMs device round alarms to the nearest minute, some to the nearest ten minutes.
WHY? What benefit does that serve?
Also some manufacturers cancel alarms when the user swipes away an app (which some users do constantly to keep the recent apps list "clean")
I appreciate that in some cases apps need to be in the notification bar in order to remain running. I also appreciate those like Tasker that have the option to hide their icons or use "empty" icons (so nothing shows).
Audible's lock-screen widget for example just does not show up unless you enable/disable 2-3 battery saving and notification settings after installing the app. I think this incantation can't be expected even from advanced users. Normal users will just give up and live with terrible UX, complain to the dev or switch to another app. The same goes for fitbit, getting it to sync in the background involves a similar mixture of battery saving and notification settings which are labeled in a way that noone would dare to change them or have questionable defaults. None of this was an issue on the Nexus 5X. To me it looks like Xiaomi has a whitelist of apps which get special defaults when installing so they work fine while others which are not on this whitelist don't get this treatment.
I can understand the benefits of aggressive battery saving especially as there are apps which behave badly but the state it has come to now is terrible UX and is just another frustration instead if actually delivering a benefit to the user. This seems to me like "optimisation" for the sake of benchmarks and marketing claims.
I suppose it must be genuinely about the user experience and brand perception by device owners. If the phone slows down and the battery drains fast users will blame the phone manufacturer, while if apps crash or app features don't work users will blame the app vendor even though the reality in both cases would be the other way around.
I have a Xiaomi A1, with a more stock version of Android, and so far this has not been an issue. But I noticed in the recent Pie update that it mentioned "battery improvements". I've had no problem with battery before now, it lasts all day easily and I get home with 70% or so. I hope it doesn't start killing the alarm clock at night, when it's plugged in to charge, just to save battery.
There is a quite clear usage pattern to support this behaviour: unless I explicitly say so, I don't want apps on their own to "do stuff" no more than I want my Ubuntu to "do stuff" while I'm doing something else. I only want the application to respond when I'm viewing it.
On Ubuntu, I always disable stuff like evolution server and automatic indexing after a fresh installation. At least you can do that on Ubuntu, that isn't necessarily always possible on locked-down systems. I'm happy that Android is quite usable these days because of Doze and background task killing.
Hell there are comments in this thread testifying that these built-in "battery savers" even kill the built-in alarm application.
is this a bug that sometimes happens? how rare is it?
You using Ubuntu so you’re fine with wasting time setting up stuff that’s just supposed to work, but most users are not
Case in point:
https://androidcentral.com/blocking-huawei-phones-downloadin...
I have a galaxy S9 but there should be the same or similar setting on yours.
I think the problem is, that many users do not know which apps require more energy due to the specific problem they solve and which apps are just badly engineered. So to let the user decide every case is a bad option (+ decision fatigue). Letting the developers decide is even worse, as they would simply say, that their app requires as much energy as they need. So the vendor thinks he has to make that decision (as they don't want their phone to being perceived as having a bad battery life), who neither knows anything about the specific app nor about the use-case (probably the worst option).
I think the system should simply report battery offenders (above the threshold of a well-engineered instant messaging app for example) to the user in a manner of 'App X used Y% of your battery in the last 24 hours. By limiting the battery usage, the app might not function as it is supposed to be. Do you want to limit the battery usage of this app?'
That way, most developers would have a chance to build good apps which do not get reported and users would stay in control.
I am pretty sure that my stock Android 8 is doing that already
- Skype - always killed
- Slack - always killed
- Whatsapp - sometimes killed, rarely
- Telegram - never killed
- FB Messenger - never killed
All these are fully featured apps with tons of different functionality.
Telegram and FBM never ever trigger "this app is draining your battery" while Skype triggers it regularly when I sometimes start it on phone.
I'm going to generalize and say that probably some apps are simple bad and need to be fixed instead of granting them exceptions and allowing to be battery hogs.
If you aren't facing issues then these apps are probably already a part of the whitelist on your device.
The system you’re saying “evolved out of the manufacturers”, runtime permission requests, is from “core Android” all they way back at 6.0
And the problem has almost never been users blindly revoking permissions, it’s blindly granting permissions.
The problem the parent comment mention isn’t the method of asking for permission, it’s the fact there literally is not a permission.
And Android already has built in “active” battery management with Doze, if anything manufacturers are ruining it with poorly coded “optimizers” that do dumb things like kill their own alarm apps...
And even if Android did add a permission to allow an app to do whatever it wants in the background and kill the battery as much as it wants, manufacturers can’t be bothered to write optimizers that don’t kill a music playing app while the user listens to music, why would they bother respecting a permission they didn’t make?
This sounds like it should be an app permission: is this app allowed to run in the background or not?
Google & manufacturerers have gone too far in the quest for the Holy Grail of extending battery life. To the point where it’s negatively affects the user experience quite often (there are quite a few examples in these comments).
It makes Android overall seem more buggy (for example, not receiving notifications for an instant messaging app is pretty ridiculous, assuming I’ve opted in and want these notifications).
One other big issue is that push-based wake-ups on Android don’t work reliably. For example, on iOS, if you want to wake up the app in the background when you come in range of an iBeacon, you can do so (with user permission), and it just works. Meaning you don’t need to run a special arbitrary background job (which is much less battery efficient).
On Android - BLE wakeups are so incredibly unreliable that entire classes of apps are becoming less and less viable. And without the loophole of running background jobs to manually scan for beacons, users (and developers) are basically shit out of luck.
But there are many people with varying use-cases - some of whome want reliable BLE detections on their devices. And if they opt-in to these notifications, then it’s a shitty experience when it doesn’t actually work as intended.
Do instant messaging apps really need to be running to listen for notifications? Why isn’t listening for notifications being handled by one central Android process that then dispatches it and launches the app if necessary?
And, in Android 9, “App Buckets” will increase/decrease throttling depending on your usage of the app.
For example, an app that you don’t open regularly, but do want receive timely notifications from (like a banking app, or calendar/scheduling app), might only get 1 window a day where it receives notifications.
So if you run e.g. (new JobInfo.Builder(1234, name)).setRequiresCharging(true).setRequiresDeviceIdle(true)... to do something heavy (like reindexing an on-device database) while the phone is charging, that job will simply not be run on some phones. You have to check whether it's been run at app startup, and if necessary run it while the user is actively using your app.
Slack would be fine, I guess.
IMO, the best way to solve this is with an explicit “Let this app run in the background” permission, rather than implementing all these “smart” features which are incredibly non-deterministic. Which leads to developer & user frustration alike.
Take the example of the new “App Bucketing” battery saving feature in Android 9, plus a banking app and WhatsApp....
App Bucketing will basically restrict your background processing based on how often you interact with the app. So for your banking app (where you usually want immediate spending notifications), because you don’t really open the app that often, it’s going to start throttling your notifications (and prevent it from running arbitrary background jobs).
But for WhatsApp on the other hand - because you’ll likely open it more often - it will have full permissions to run in the background any time.
If as a user you wanted to prevent arbitrary WhatsApp background jobs and get instant banking notifications - well tough luck!
Point being the majority of the apps are badly coded to poll or drain battery, send unnecessary notifications.
This reminds me of the popup blocker thing in web browsers. While there were some legitimate uses most of the time it's abused so every browser blocked it.
1. They are not enabled by default
2. Their settings screen explicitly states what the modes do
3. They can extend battery life significantly
The most aggressive mode is called Ultra Stamina, and it works by basically turning the phone into dumbphone mode -- complete without any internet connectivity, calls, SMS and alarm clock only -- and the phone has no problem lasting a week.
I use these modes extensively when going backpacking for several days, as I do not have to carry any power banks, which saves precious gramms :)
edit: punctuation, grammar
Calling Sony "toxic" for including a useful OPT-IN feature to extend battery life? Pfff...
Of course, then you have the issue of finding a quality midrange or higher end phone with a removable battery in the first place. They are an endangered species due to the thinness war.
I prefer external charging bricks -- if you upgrade your phone, you might need to buy a new cable with an external brick, but you are more likely to need a replaceable battery with a new form factor or output.
The way I read GP he disabled everything except calls, SMS and alarms.
Which kinda makes sense, you want something for authorities to track you in case you end up missing and unable to call for help yourself.
https://hackernoon.com/notifications-in-android-are-horribly...
But how did you guys deal with the situation where FCM delivers and displays a notification without waking your app up. In that case, if the user dismisses the notification without opening it, then it will count as delivered by FCM, but not as delivered by your app, right? Which isn’t actually the case.
a) I wholeheartedly want this behaviour. The phone lasts 2-3 days without recharging, and I no longer fear leaving home with 30% battery.
b) It's not an app that kills background apps. It's Android's own Background Activity Manager, where apps that are not whitelisted can't wake up the CPU. They run only when the CPU wakes up for some other reason (screen-on qualifies but it's not the only opportunity).
I had to get used to it. In one instance the alarm didn't wake me up, because it is not whitelisted to wake up the CPU. After enabling the correct apps, I maintain pretty much the same great battery life and all app functionality I want.
My grandma is 89 now, she uses Whatsapp, Youtube and whatnot and I am not kidding but within 2 months she had:
- AVG antivirus (an ad told her she had a virus)
- She had batterylife for 7 hours before a charge was needed due to shitty apps
- Ads on her lock screen?!
- Ads on her homepage
After 6 months and 3 house calls to fix her phone we gave up and she got my aunts old iPhone 5s with a new battery.
It runs iOS 12 now and it runs flawlessly and protects her from all the stuff I mentioned.
From a guy that has always had Android: most users need iOS level protection. Just simple facts.
*Speaking in terms of launch MSRP.
I wonder how they'll deal with the new gesture nav (both iOS and Android), because I think that's possibly more confusing to a layman.
If you disable the background activity manager, under Settings | Battery, you get the same battery life you do on iOS (about a day, give or take).
> Yes, even Samsung - a dominant vendor in the Android market - is using nasty battery saving technique which may kill background processes and render alarm clocks useless. See below for workarounds.
Wait, do you really need a background task for alarms?
(why) isn't there a system-level service to notify and wake up your app at a pre-defined time or interval?
The aggressive battery settings of most vendors only interfere with badly coded apps to begin with, apps that use background tasks when they should be using more appropriate APIs.
But some tasks do need to run in background, don't they? Specifically, sports tracking apps. Had a lot of issues with those on on various phones; now I simply don't switch out of the tracking app at all while it's running (otherwise, I can never be sure it simply won't be tombstoned in the background).
there is. But, defining services is extremely easy and so people often just roll their own. Plus, it's academic.
My S8 seems a lot less extreme in this regard.
There doesn't seem to be any general-purpose email app on Android that can actually notify me at a reasonable interval (less than 10 minutes, if not immediately). Even after disabling every power-saving feature I could find, Samsung is still killing and crippling their own default app.
I understand that it takes a bit of battery to poll an IMAP server every few minutes. But if I want an app to be able to poll an IMAP server in the background at the cost of having to charge my phone a little more often, that's my choice. Besides, my old phone didn't have this problem and its battery still lasted a whole day.
What's even more infuriating is that the phone allows preinstalled social networking apps that I don't even use to continue running in the background while it happily kills the apps I actually need.
Your imap client is trying to hold a TCP connection open to your server, which isn't allowed.
There's a good reason the phone doesn't allow that. Firstly, the push notification service can be waiting for a notification for an app while the app is entirely unloaded from RAM. Hundreds of apps can be listening for notifications at once, with no system resource overhead.
Secondly, imagine every app wanted to have a TCP connection open to it's own server. TCP must generally go through your wifi/3g providers NAT. That NAT gateway will drop idle connections, with the rules on which connections are dropped varying for every type of router and provider. In general, if you want reliable delivery, you're going to have to send some packet down a TCP connection every 5 minutes, although some providers it can be up to every 3 hours. If every app applies it's own heuristics to figure out how often to send a keep-alive message, and you have hundreds of listening apps each with their own connection, and no synchronisation between them, your phone will end up waking up every few seconds for some app to send a keep-alive.
Instead, Google keeps open just one connection. They have a serverside database of all network providers to know which ones drop connections when (BTW, this is a big advantage of using your cable providers default modem. If you have your own modem, this mechanism won't be accurate). It can then wake up and send just one keep-alive at the exact correct time.
From the server side, Google can batch messages to clients. It can decide that receiving 8 new marketing emails is important enough to sync to your phone, but only if the phone will be waking up for some other reason. Then when a snapchat message comes in, both the mail app and snapchat will be notified by a single wakeup of the phone.
Overall, it's a very good design. There are only 2 big downsides:
1) It's centralized. Nobody else can run a notification server. They have a monopoly on delivering notifications.
2) Their server isn't very good. It doesn't have the capability for example to simultaneously listen on 3G and wifi. It sometimes gets overloaded and unnecessarily delays messages. Their database of network providers is sometimes a bit off, meaning your phone is sending keep-alives every 30 minutes, while the connection times out after 20 minutes, meaning there is a 33% chance your message will get delayed by up to 10 mins.
The O/S should, however, honor an app's request to wake up every 5-15 minutes to open a new connection, do some things with it, and go back to sleep. Especially if the user has given explicit permission to let the app in question use all the battery it wants. Periodic wakeup is what most email apps expect when they're set to "polling" mode. It used to work perfectly until about two years ago. It doesn't work anymore on recent Samsung phones. The system just ignores the wakeup schedule set by the app.
Probably not related to this, but still incredibly weird, not to mention seriously broken.
Battery life consumption rarely comes up as a feature bullet-point for an app writer, because visibility on whether a given app is a battery hog is low (both for developers and users). There are a couple of reasons iOS was so draconian about background processes for most of its history, and this was one of them. This ecosystem shift puts pressure back on developers to get creative and ask hard questions about how much energy they really need to consume for their tasks.
One issue is that these first furtive steps in that direction may not be putting the tools in the developers' hands to do that well. But everything in software starts at an early phase.
(It'll be interesting to see whether the market prioritizes battery life by getting the phones implementing these features or app richness by treating these phones as "damaged" and routing around them. This site certainly helps customers make that choice).
- google mandates that killing background apps must be based on actual battery consumption
- when an app that requested background permissions is background-killed, this is reported to the app developer and OS vendor in some sort of aggregate metrics they can see
- users should get some kind of report or notification as well about it
You would instantly see both OS vendors and app developers trying to optimise the battery life of their apps so that they can stay alive.
Ideally, users who want to should be able to actually set thresholds on how much battery any app can consume. Eg: if I am OK that my phone only lasts an hour I should be allowed to tell it to keep my minecraft server on on the background so everyone can keep playing.
Both platforms offer extremely easy to access, at-a-glance views of which apps are using the most battery for any given period.
I want to have a list of all running apps and their background services. I want to be able to put any app/service from this list down, and have it stay down. That is, I want the ability to kill an app and/or their services, and not see them again until next reboot or the next time I launch the app in question.
It's not that big of an UX burden, and it would solve a lot of the battery management issues.
I didn't do much Android development, but last year I had to develop a small app doing a continuous background task.
Yes, it is hard to do that in Android (it seems). But you are supposed to use all sorts of other mechanisms that Android provides. Like for an alarm clock, I guess you tell some system service to play the sound and then go back to sleep. The sound keeps playing and your app sleeps (I guess - don't know this particular case).
Some things seemed really hard to do, but it is by design, and users really need to be protected from vampiric apps.
The UI makes it very clear if you have it enabled, it explicitly tells you what it does and I never missed anything because of it.
If you keep your phone on silent you don’t care if it delays fetching messages until you actually turn on your screen anyway...
That doesn't follow. All I want is my phone to be quiet; I don't stop caring about timely notifications because of this. Also, just because my phone is on silent doesn't mean vibration is turned off and, in the case of my iPhone, the notifications go to my Apple Watch.
My phone is almost always silent because of our dogs, but I have it lying on my desk and see when something has arrived due to the blinking indicator.
This is the best thing for me. Iam fed up of the notification loop of apps that I have to eventually delete.
Thank god for telling me to buy a Nokia next time.
My alarms go off just fine (although I vaguely remember it not going off once or twice a few updates ago), my activity tracker works fine[0] and syncs periodically. I don't use GPS constantly. Signal notifications were also delayed a few updates ago, but now everything runs smoothly.
I find it a worthy sacrifice to make for a sturdy Android One phone with solid performance and a battery that can last two days on medium usage. My activity tracker lasts weeks without charging (comparable to a Kindle).
[0] Worth pointing out that my activity tracker was also developed by Nokia (before they've sold their health division to Withings), so it may receive some special treatment.
Would you mind testing if background file transfers work as standard and with manual battery optimization whitelisting?
[0] https://www.reddit.com/r/Nokia/comments/afkuh4/dontkillmyapp...
It seems to be that these vendors ship builds of Android with aggressive battery-optimized defaults that breaks applications that rely on being able to run in the background.
The only push notifications I want are messages from humans.
If you browse through Alarm Clock app in Google Play Store, you will realize most them are having similar customer complain - "The app used to work till I upgrade Android OS"
Currently, I need to post the text in my Google Play Store description :-
" Reminder doesn't work reliably for certain devices. Their over aggressive Battery management mode, have prevent reminder to work in background. Please turn off that "feature", allow WeNote runs in background, if you want reminder to work reliably.
Please read https://dontkillmyapp.com/?3 for solution. "
Each vendor has 1-5 poop emojis with Nokia having 5 and Stock Android only 1
Since when do you need to serve emojis from a third party? I thought you can just insert them straight into your HTML. Or is that not cool enough?
It took a few seconds for that to be visible when I visited the page, initially only showing as large dots.
It's a fairly divisive issue - I can understand developers getting frustrated if their app's functionality is broken, but I do think this should be more in the user's control. A permissions-based model for backgrounding would be better, but there's too much permission prompting as well on Android (and this is something you can't back up - so on any restore, you're left 'allowing' permissions in every app you use in a new way - yes, when I select the camera mode in an app, I want to allow use of the camera - gets tedious across a bunch of different apps).
My S9 (or maybe it's just Android) also puts a notification up if an app continues to run when I click 'back' out of it (or some other heuristic - it's not for every app, but it does a good job of identifying which are running) - which I think is a better compromise. It makes it much more visible which apps are consuming resources, and tapping the notification takes me to the App Info page with the 'Force Stop' button at the top. It's a bit noisy (it appears even for the stock music player, where obviously I want that to continue running), but it serves well as forcing visibility of battery hogs (whether it's through incompetence or nefarious background data collection), and reassuring to see it there for the apps I want running in the background. I would rather see more of this sort of visibility - maybe as well as just overall battery usage, the battery use in settings should show battery usage by apps when the screen is off or the app is not in the foreground. As the device owner, I want to be in charge of which apps get that privilege.
If your app wants to run a background service which degrades the users battery, you are degrading the user experience for that user, and all the other apps they use.
Another app on the same phone which is very power efficient will still not get used if the battery is dead!
App developers who use up the phone battery should be required to compensate those who use it sparingly.
Google could set up a market for 'milliamp-hours', where each mAh used up by an app is worth $0.00001c. Apps will put money in the pot (subtracted from ad revenue) proportional to how much power they use, and be handed out to all apps based on app usage (how many hours in the foreground for example).
Your idea basically means that apps that spam ads can use more power, even if they're used less. And free or paid apps without ads couldn't afford to run at all. How does this help the user?
At this point you discover it costs more to render an ad to the user (and especially to download it) than it pays the app developer ...
I've been out of Android app development for some time, but I hang out with a few Android developers, they usually have most of the issues with Samsung, they say that there are often some quirks that have to overcome. That mostly corresponds to my outdated experience.
EDIT: More info on the subpage: "To avoid the system to automatically revert the not optimized setting, you must also lock the app into the ‘Recent App’ list." https://dontkillmyapp.com/oneplus
Makese sense no since I have a Oneplus.
It is time for the vendor neutral cell sized tablet with only a data module to avoid the draconian telecom monopoly protection regulations.
Most developers won't admit it but a lot of apps are quite terrible nowadays. Yes it is very convenient that your app does something in the background that is maybe useful, but it's only one app. When you have 30-40 apps installed w/o auto kill, the battery drainage is terrible.
For me moving from LG to Xiaomi was great in terms of battery life. And yes, sometimes there are app which shouldn't be killed but it's easy enough to change their setting in the battery saver. And really these are only few, most app deserve the auto kill, as they abuse the priviledge of being able to run in the background.
https://support.signal.org/hc/en-us/articles/360007318711-Tr...
The wording in the linked website is talking more specifically about cpu limits, which is how most os manage background resources, whats the problem with that?
Sleep tracking is a good example you should use an event system, but developers are lazy and use "while (true) {}", which is my point.
I don't need an online store app to eat up my phone's battery, and disabling background by default seems to be only option here.
The app doesn’t need to be running in the background.
On one hand lag is essentially gone, on the other I usually have to "restart" an app(in the Android sense of the word) if I want it to regain focus. E.g. tabs in Chrome always refresh, which has its downsides.
If anything, my gf's Galaxy is much worse in this respect. She doesn't usually get Hangouts notifications until she explicitly launches the app.
https://www.reddit.com/r/Nokia/comments/actk7z/android_one_p...
https://hackernoon.com/notifications-in-android-are-horribly...
but no instead we'll probably get fuschia and android will be deprecated lmao
Google has no motivation to make sure that the ecosystem is good as long as they can sell ads and collect user data.
More specifically, could this be the reason I've recently not received Discord notifications for DMs?
Lock em down. App developers are terrible and have no taste. Y'all had years to make these devices useful and failed. Instead it's all cloud idiocy.
you may get linux on your hardware but goodluck getting hardware vendors to support linux even on a supposedly "linux compatible" device in any way
Actually, it is not a bad thing.
https://community.spotify.com/t5/Android/Music-stops-play-af...
(iOS user now)
Switching the the built-in clock app (it's whitelisted, probably) fixed the issue, though it's not a good user experience. (To note: there is a settings screen to override per-app background closing behavior, but for an alarm clock I don't mind so much which app I end up using.)
It is pretty annoying still having the whitelist e.g. VPN apps manually whilst travelling as the phone was closing them constantly.
It's fine for vendors to do specific things, but it has to be very clear, documented, and within certain parameters.
Google has to realize that they are responsible for coordinating and publishing this information, and making sure it's clearly communicated to developers.
That they don't grasp this is byzantine.
There's a corollary in tech, relating to how many API's are released without proper documentation, thereby rendering all of the 'hard work' of making the software basically useless.
I should add: dealing with these kinds of problems are quite fundamentally different than other engineering challenges. For some reason, while working on this stuff, I can't help but feel frustrated and angry, mostly at Google (and the vendors) - because we're essentially 'solving their stupidity'. It's costing you money, and many small businesses don't have spare money and risk to hand out. It seriously strains developer relations and perpetuates an existential notion that developers have been 'lied to' by the platform vendors.
The notification area is becoming increasingly useless (for actual notifications). Since upgrading from 4.4 to 7.0 last year, this has been bugging me quite a bit and I haven't yet found a solution. I was much happier with the old OS, but security updates...
Again, Cyanogenmod based on Android 4.4 was better here: I could selectively hide notifications with certain contents. In Android 7, I can only choose not to display notifications from a certain app. I still have to write something that reads notifications and kill them selectively, but then I guess such a service would get killed as well without its own annoying notification... (The "you must update google play services to use this app" notification (which is a falsehood) is also annoying the crap out of me, another issue I didn't have on 4.4.)
I didn't actually know the wake lock would still work if you hide an app's notifications, I thought the notification was the prerequisite for not getting killed.
It's a big issue with IM apps like Conversations or calendars and contacts synchronisation apps like DAVx5
Some example: https://github.com/siacs/Conversations/issues/2771
I found this helpful in debugging an issue I've had with my OnePlus - namely, many apps that I'd like to get notifications from abruptly stop getting them after a while, and I have to reopen them to get notifications. Today alone I had to manually open Facebook Messenger and Venmo in order to get notifications from them - this seriously degrades the functionality of those apps since opening Messenger multiple times a day still isn't apparently sufficient to exempt it from being "optimized".
The first affected things tend to be synchronisation jobs, but it’s distressingly common for these systems to break things so that notifications just mysteriously stop working outright—with no diagnostics of any form for user or developer.
Or how about emergency notifications? I live out in a rural area and it’s bushfire season; I want the VicEmergency app’s notifications pronto so that, if a threatening fire starts nearby I can get out quick.
This is about OEMs breaking the guarantees of the OS. Yes, Apple restricts your background processing time, but it will still reliably deliver APNS push notifications or keep your running if it's actively providing turn-by-turn nav, background calls or something that API deliberately allows you to do.
With Android, the issue is that OEMs listed on that site break guarantees that Android API gives you. Your app suddently stops receiveing push notifications because it's not on the whitelisted "golden set" - breaking smaller messengers like Signal. Or the OEM "battery saver" kills off Google Maps while it's running turn-by-turn during your drive. Issues like that, which are significantly different than having Doze mode save your battery. Or you schedule a sync job once per day on Wifi (which JobScheduler API gives you the ability to do) and Huawei decides to just break the API and not run it.
It seems like in Android the developer just assumes their app will be able to run in the background, except some versions just decides to kill it based on their own agendas.
That hasn't been true for some versions now. Yes, there's a mode where apps can run in the background without restrictions, but that hasn't been true for most apps for years now.
This is such an old meme and there are plenty of existence proofs that it isn’t true. There are third party apps for every single app on iOS including navigation, podcasts, mail, music players, calendars, password managers (with integration APIs specifically for them as of iOS 12), weather, notes, etc.
Unacceptable: https://developer.apple.com/app-store/review/guidelines/#una... Spam: https://developer.apple.com/app-store/review/guidelines/#spa... Copycats: https://developer.apple.com/app-store/review/guidelines/#cop...
You can't make your own App Store, you can't ship your own browser -- https://developer.apple.com/app-store/review/guidelines/#sof... -- you have to use HLS, you can't use background features except for approved categories: "VoIP, audio playback, location, task completion, local notifications". "Apps that create alternate desktop/home screen environments or simulate multi-app widget experiences will be rejected."
I'm not saying the rules aren't much improved from what they used to be -- it's been years since the simple advice was "don't ship something we ship," but ... at its core, it's still somewhat true. You have to ship an original app -- and all of the app categories you mentioned have truly original apps on the App Store already.
In Android, you're technically allowed to run whenever you feel like it, but starting with Android 6, Google started limits, but I don't think apps get much feedback about when they might run, or if they can access the network when they do run. And the multitude of OEMs that are all dieing to make their product stick out means it's really a crapshoot; some oems were trying to do this before Google's release of the feature, some enable Google's version, but very aggressively, etc.
I understand the intent of these features, but there really needs to be a better way. Some apps do real, useful, work in the background, and it's not great for users when that can't happen. Many apps should probably only run when they're in the foreground. Either way, the app should be informed, so it can do the best it can, including informing users why it's not working and being able to direct users to where they can fix it, if desired.
This is why Android allows you to still run unrestricted if you show a persistent notification (as long as there's enough RAM). The whole point of the link you're commenting on is that some OEMs break this API.
But they have an arguably better push notification system which seems to use less battery and work better with sleeping apps.
For example, push notifications are handled by one system process, and will only open the relevant app when the user clicks it.
It may sound radical, but only countermeasure we developers have is to block installments of our apps on such devices until moment manufactures stop doing this nasty "optimizations". It's like taking users as hostages, but that exactly what manufacturers are doing as well.
PS: for all down voters, I would like to hear from you if you just android user or you've also developed some app (I doubt you did).
Users want better battery life. They don't want a app using it up.
Feel free to block the installation of your app on devices that you feel unfairly target background apps, they'll just use a different application.
with some devices you just can't find alternative that would work reliably in the background for example. Imagine sport tracker, that needs to record locations even when in background. You cannot just use another app, because any sport app could get killed due excessive power management.
Favoring some apps by manufacturers putting them on a whitelist to prevent them from being killed should be considered as unfair practice (potentially illegal).
Everybody wants better battery life, but also their alarm app to wake them up, or tracking app to record their runs in the background, receive notification when there is new email or im message, etc. And these functionalities get disrupted by excessive battery management (killing apps in the background).
Somebody thinking he knows what users want and making decision based on this assumption (without really asking user) is exactly what brought us here. We are not all the same, somebody can have bit different priorities then you.