Hacker News new | ask | show | jobs
by scarface74 2715 days ago
Does Android not have the concept of “local notifications” where you can tell the OS to schedule a notification to be sent to the app to wake it up instead of being in the background the whole time?
4 comments

It does - the one that works properly is https://developer.android.com/reference/android/app/AlarmMan...

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.

> 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?

>WHY?

Because China.

Having lived in China for a few months with an Android phone I can with absolute certainty tell you that this is needed over there. The amount of garbage apps, even from big companies like baidu is enourmous!

And without a Google playstore, or play services, or play safety thing it is an absolute wild-west of background alarms, API calls, battery draining and whatnot.

Sorry, how does rounding to the nearest minute or nearest TEN minutes solve any problems?

Like are apps setting alarms for every 3 seconds or something for no reason??

Yes. Rounding to 10 min means you fire up the cpu and do all apps at once then go idle.
Oh, so when we say "alarms" we mean "background processes that occur at set intervals"?

Not literally "alarms", like the ones that ring?

Rounding timers can greatly increase battery life, at the expense of apps not working - but who checks that apps work on their phone before buying it?
Limits the potential battery impact.

Without this restriction, how long before an app maker schedules their alarm every millisecond?

Probably a crude way to stop apps from waking themselves every minute.
'Performance'

Edit: It's become the new '911'... Family Guy Joke!

As others replied; it does. But the API does not behave consistent on different brands and API levels.

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'm one of those users. The visual clutter leads to mental clutter. Having a "clean" notification bar makes it easier to ignore the pavlovian "check your phone!" conditioning that has built up over time.

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).

It has, but from what I've read some of these "optimizers" helpfully "optimize" the scheduled notifications away or move them around in time.
Yes, and these manufacturer optimizations often break them.