News for hackers. Stuff that matters.
Re:Android vendors, don’t kill my app by simias on Monday January 14, 2019 @04:07AM (#18901704)
Isn't it also the consequence of taking the control away from the user? Why can't I whitelist which applications I want to allow to run in the background? Why do I still have to grant an application all the permissions it requests when I install it instead of being able to turn them on or off individually?

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.

Re:Android vendors, don’t kill my app by CodeWriter23 on Monday January 14, 2019 @05:43AM (#18902072)
No, it’s the consequence of permitting background tasks at will. Apple took some heat, and there is learning curve associated with doing it their way, but they actually thought it through and created an energy-efficient architecture that addresses common use cases. And apps that don’t fit those use cases - what are they doing with your device?
Re:Android vendors, don’t kill my app by anc84 on Monday January 14, 2019 @07:41AM (#18902536)
Can I run XMPP or IRC on an iphone by now or does it still only receive messages when foregrounded?
Re:Android vendors, don’t kill my app by dithering on Monday January 14, 2019 @08:53AM (#18902904)
"Use a bouncer" might be the answer there. All engineering is compromise, and needing a bit more compromise to support legacy applications is not unreasonable.

(In fact, why are you running a stream-oriented application over such an unreliable connection at all?)

Re:Android vendors, don’t kill my app by admax88q on Monday January 14, 2019 @11:23AM (#18904111)
My XMPP client works perfectly on my Android phone. Prompt and reliable notifications of new messages. Better than most "Push Message" based clients I've used for other chat services.

It's consistently the last in battery usage as well.

Honestly I don't need the OS to protect me from poorly engineered apps, I just need it to correctly blame the apps so I know which ones to stop using.

Re:Android vendors, don’t kill my app by apexalpha on Monday January 14, 2019 @11:29AM (#18904162)
>Honestly I don't need the OS to protect me from poorly engineered apps, I just need it to correctly blame the apps so I know which ones to stop using.

No, but the other 6 billion people on the planet do.

Re:Android vendors, don’t kill my app by ndiscussion on Monday January 14, 2019 @12:26PM (#18904603)
Which is why Apple is so big. Also Walmart. Also Top40.
Re:Android vendors, don’t kill my app by vxNsr on Monday January 14, 2019 @02:35PM (#18905718)
Classic HN response.

I'd guess a FTP and a linux file-server would solve all your filesharing woes as well.

No dev making a mass market device or software should build as if the 1% graybeard engineer is gonna be the only user, that's a lot more user hostile.

Re:Android vendors, don’t kill my app by admax88q on Wednesday January 16, 2019 @01:20PM (#18923382)
The "which apps are using battery" feature is easily useable by novice users.

However most phone vendors incorrectly assume "background connections" will drain battery life despite evidence to the contrary.

Phone vendors have a vested interest though in forcing developers to use their proprietary "push" feature for syncing to phones, they say it's for "battery life" but really its about vendor lock in.

A well engineered app can sync over its own TCP connection just fine and not hurt battery life, but then such an app can work on any device, not just blessed Android builds that have access to GCM.

Re:Android vendors, don’t kill my app by stickfigure on Monday January 14, 2019 @03:14PM (#18906059)
Android's "these are the apps killing your battery life" interface is perfectly usable by Joe Everyuser. This is a specious argument.
Re:Android vendors, don’t kill my app by vxNsr on Tuesday January 15, 2019 @11:56AM (#18912576)
Reality suggests otherwise.

Every modern phone today will give you a list of the apps that take the most juice, and yet somehow for some reason people still install facebook. We might need to protect users from themselves.

Re:Android vendors, don’t kill my app by admax88q on Wednesday January 16, 2019 @01:18PM (#18923347)
Or users could start holding facebook accountable for shitty battery life.

I don't understand why phone manufacturers need to add features to protect facebook users from facebook. facebook has the money to build an app that isn't shit.

Re:Android vendors, don’t kill my app by dithering on Monday January 14, 2019 @02:40PM (#18905773)
Never mind HN, that's a classic Slashdot response.
Re:Android vendors, don’t kill my app by anc84 on Monday January 14, 2019 @10:33AM (#18903694)
A bouncer is not a satisfying answer, then I could just use something web-based anyways.

My Android tablet is on a stable WiFi network at home...

Re:Android vendors, don’t kill my app by lol768 on Monday January 14, 2019 @09:42AM (#18903275)
>"Use a bouncer" might be the answer there.

Weechat and weechat-android are great choices here. Best CLI and Android IRC clients I've used, and I've tried quite a few.

Re:Android vendors, don’t kill my app by rootusrootus on Monday January 14, 2019 @09:11AM (#18903017)
I run Cisco Jabber on my iPhone, and it seems to run fine. AFAIK that is XMPP.
Re:Android vendors, don’t kill my app by JustSomeNobody on Monday January 14, 2019 @09:27AM (#18903135)
Getting messages should not/does not have anything to do with running in the background.
Re:Android vendors, don’t kill my app by toast0 on Monday January 14, 2019 @09:50AM (#18903339)
If you want a messaging app to work well, it should send and receive messages when the phone has network connectivity and power. Power is a prerequisite for running in the foreground, but network connectivity is not. Some people may in fact want messaging apps to only work while in the foreground and network available, but I suspect that's less desired.

If you're trying to run standard irc and appear online as much as possible, that's not going to work in iOS without a bouncer to stay online for you and send push messages to send notifications and allow the app to run for a bit to download the messages.

It's probably not a bad idea on Android too, it's technically possible to run as a background service and stay connected, but there's a lot of uncertainty, because other services can crowd you out, and you're at the whim of Google and oems with power management these days.

Re:Android vendors, don’t kill my app by fixermark on Monday January 14, 2019 @01:22PM (#18905069)
And also, it's the 21st century and we don't need chat protocols to be client-side-liveness chatty to "stay on" when the entire cellular network is architected to find devices and route messages to them.

IRC isn't a well-designed protocol for this use case, and a "land-side" bouncer that bridges the chatty protocol to a lazier protocol ought to be more energy-efficient overall.

Re:Android vendors, don’t kill my app by int_19h on Monday January 14, 2019 @02:24PM (#18905617)
Well-designed or not, it exists, and sometimes you just want to use it, without a lecture on how it's suboptimal.
Re:Android vendors, don’t kill my app by fixermark on Monday January 14, 2019 @03:10PM (#18906023)
That's fine. you are "free" to hack your own version of Android that modifies the APIs to disregard power-management best practices.

... and maybe your own hardware to run them on. But I wouldn't expect any major player competing against other companies to do the work for you when the outcome is supporting some chat protocols that most people don't use.

(Otherwise, if you're expecting vendors to do it for you, you get to expect the lecture that comes with that expectation, in the form of APIs designed to minimize the ease of doing the wrong-for-the-average-utility-of-the-platform thing. Your cell radio could probably be adjusted to operate as a spark-gap transmitter also, but I don't expect them to provide an easy API for that either ;) ).

Re:Android vendors, don’t kill my app by lol768 on Monday January 14, 2019 @09:41AM (#18903268)
Getting messages requires an open TCP connection, hence it really is quite important (at least with IRC) that the app stays running in the background.
Re:Android vendors, don’t kill my app by JustSomeNobody on Monday January 14, 2019 @04:46PM (#18906839)
This is what the push message API in iOS is for. It wakes up the app when messages come in.
Re:Android vendors, don’t kill my app by lol768 on Wednesday January 16, 2019 @05:46PM (#18926281)
> This is what the push message API in iOS is for. It wakes up the app when messages come in.

IRC isn't reliant on a proprietary push message API, though (be that provided by Apple or Google).

I'm sure there are long-lived bouncer plugins that will integrate with said APIs, but the core IRC protocol is not suited to or designed for devices that aren't capable of a long-lived connection.

Re:Android vendors, don’t kill my app by jabberthemutt on Monday January 14, 2019 @06:13PM (#18907473)
Which means there is a third party eavesdropping on chat.
Re:Android vendors, don’t kill my app by feikname on Monday January 14, 2019 @09:48AM (#18903313)
Receiving messages (aka "listening" in server jargon) is essentially a background task, constantly probing to check for any changes.
Re:Android vendors, don’t kill my app by jsjohnst on Monday January 14, 2019 @11:02AM (#18903963)
I think the point being made is that’s a terrible use of resources, not only are you keeping the app running, but you are also forcing the power hungry LTE radio to stay on more.

This idea that the end device should do all the work is not a sustainable approach. There should be a server side component that is handling this for you and sending push notifications when your app needs to wake up for new data.

Re:Android vendors, don’t kill my app by admax88q on Monday January 14, 2019 @11:26AM (#18904137)
> sending push notifications when your app needs

How do you think push notifications work? There isn't some magic in LTE to wake up your phone. Your phone needs to keep a connection open in the background and periodically wake up the modem to check for new information.

I use Conversations (XMPP client) on Android, it keeps a plain old TCP connection open in the background and honestly it does not much battery at all. It's consistently at the bottom of battery usage according to my phone.

Re:Android vendors, don’t kill my app by fixermark on Monday January 14, 2019 @01:25PM (#18905084)
Do push notifications take advantage of knowledge of the physical layer of the network?

It's a lot cheaper to keep an LTE radio on in a low-wattage "ping me if you need me" mode and trust the 'infinite-power' landside terminal to notify you of messages than to wake it up once every N seconds to loudly ping a cell tower "HEY LET ME KNOW IF I HAVE ANY MESSAGES KTHX."

Re:Android vendors, don’t kill my app by jsjohnst on Monday January 14, 2019 @07:48PM (#18907996)
> How do you think push notifications work?

There’s a very distinct difference between having a persistent connection that only transmits data when there’s something notable vs having a connection that constants pushes a kitchen sink of data that may or may not be needed. Sure, if you sent a push notification on every single message and status change on the IRC server, it’d likely use the same amount of (or maybe more) battery, but who does that?

Re:Android vendors, don’t kill my app by JustSomeNobody on Monday January 14, 2019 @04:48PM (#18906858)
Right. That's why there's an API for it. Each app doesn't have to stay awake listening. The OS will wake the app up.
Re:Android vendors, don’t kill my app by feikname on Monday January 14, 2019 @10:49PM (#18908726)
Oh, that does make sense.

In that case, having the app run the background really does seem like a waste when compared to leaving the OS to do this task.

Re:Android vendors, don’t kill my app by dmitriid on Monday January 14, 2019 @08:12AM (#18902673)
Slack receives messages with no problem.

If XMPP/IRC can’t provide that, it’s not iOS’ problem.

Re:Android vendors, don’t kill my app by amaranth on Monday January 14, 2019 @02:31PM (#18905687)
Slack works because of push notifications. A random IRC app can't handle push notifications for you because they aren't the IRC server and aren't running a bouncer for you. On the other hand, the IRC server can't handle push notifications for you because they don't have an app signed with Apple's key sending the notifications.

Basically protocols as a general thing can't work on iOS, only individual apps/services which get to read all your messages and access your login credentials work.

Re:Android vendors, don’t kill my app by dmitriid on Tuesday January 15, 2019 @03:35AM (#18909651)
> Basically protocols as a general thing can't work on iOS, only individual apps/services which get to read all your messages and access your login credentials work.

Which I think is a reasonable requirement for a chat service, especially on mobile.

Re:Android vendors, don’t kill my app by fixermark on Monday January 14, 2019 @01:25PM (#18905089)
I don't know why you were downvoted; it's a solid-and-concise critique of the difference in protocols.
Re:Android vendors, don’t kill my app by zeveb on Monday January 14, 2019 @10:34AM (#18903701)
> And apps that don’t fit those use cases - what are they doing with your device?

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.

Re:Android vendors, don’t kill my app by fixermark on Monday January 14, 2019 @01:26PM (#18905097)
You've definitely made the case that you don't want an iOS device.

... the market appears to be making the case that you are not the average consumer, but that's an independent variable.

Re:Android vendors, don’t kill my app by AnthonyMouse on Monday January 14, 2019 @02:47PM (#18905833)
The market has consistently been choosing Android phones in higher volumes than iPhones for years.
Re:Android vendors, don’t kill my app by Nursie on Monday January 14, 2019 @04:26AM (#18901789)
> Why do I still have to grant an application all the permissions it requests when I install it instead of being able to turn them on or off individually?

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

Re:Android vendors, don’t kill my app by kijin on Monday January 14, 2019 @07:16AM (#18902456)
It is true to some extent since Marshmellow. But apps can tell when their permissions are denied, so some of them straight out refuse to start unless you give it all the permissions it wants. This is especially problematic when a new version of an app holds your data hostage and refuses to start unless you give it a ridiculous new permission.

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

Re:Android vendors, don’t kill my app by marvelous on Monday January 14, 2019 @12:19PM (#18904555)
I really wish I could whitelist which contacts each app could see, so WhatsApp only sees the ones I want on that app.
Re:Android vendors, don’t kill my app by Nursie on Monday January 14, 2019 @07:46AM (#18902556)
> But apps can tell when their permissions are denied, so some of them straight out refuse to start unless you give it all the permissions it wants.

I'm pretty much fine with this, though the data-hostage situation you describe does seem bad.

You're right that from a user control perspective, the cyanogenmod approach is likely best.

Re:Android vendors, don’t kill my app by nkristoffersen on Monday January 14, 2019 @06:44AM (#18902309)
That is the case in iOS. All permissions are optional and the app must gracefully degrade if permissions are denied.
Re:Android vendors, don’t kill my app by stronglikedan on Monday January 14, 2019 @10:03AM (#18903440)
Unfortunately, some apps just degrade, ungracefully, by flat out refusing to run without certain permissions.
Re:Android vendors, don’t kill my app by theshrike79 on Tuesday January 15, 2019 @04:24AM (#18909878)
On iOS? That's against app store rules if I remember correctly.
Re:Android vendors, don’t kill my app by sudhirj on Monday January 14, 2019 @04:14AM (#18901736)
Should also see if the killer apps are phoning home every time they kill anything, along with info about which app is killed on whose phone at what time. Becuase, you know, analytics.
Re:Android vendors, don’t kill my app by kda26 on Monday January 14, 2019 @06:30AM (#18902246)
On my phone (android), going to apps>selecting app I want to run in the background>battery>background usage I can allow the app to run unrestricted in the background.

All android phones I've owned had this option.

Re:Android vendors, don’t kill my app by morganvachon on Monday January 14, 2019 @07:44AM (#18902552)
My understanding from the OP website is that this is ineffective for certain popular phone vendors' customizations. In particular, the Nokia phone listed comes preinstalled with an app that aggressively shuts down any running process, whitelisted or not, if the screen has been off for 20 minutes. There's simply no way to stop this behavior apart from gaining root and uninstalling the battery "saving" app, or flashing a stock Android image that doesn't contain it.
Re:Android vendors, don’t kill my app by andai on Monday January 14, 2019 @08:22AM (#18902715)
A design so disrespectful it borders on malware.
Re:Android vendors, don’t kill my app by noelsusman on Monday January 14, 2019 @04:18PM (#18906592)
The Nokia one is egregious, but their second worst vendor (OnePlus) allows users to whitelist individual apps, though there's a bug right now where that setting gets reset randomly.
Re:Android vendors, don’t kill my app by sudhirj on Monday January 14, 2019 @04:18AM (#18901751)
And yeah, the permissions model in Android vs Apple is different, but multi tasking in particular feels the same. i.e. Apple has fine grained permissions on demand for contacts, microphone, camera, location, etc, and requires that all apps gracefully degrade when permissions is denied.

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.

Re:Android vendors, don’t kill my app by simonh on Monday January 14, 2019 @04:39AM (#18901843)
As I understand it, on iOS third part apps don’t actually do any tasks in the background, most such services are actually implemented by platform services provided by Apple that the third part apps request or subscribe to. So for example apps request an Apple service to do a background download on their behalf. Or the app subscribes to a notification feed that wakes it up when triggered to handle the notification, but the app doesn't do a download or wait for notifications itself.

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.

Re:Android vendors, don’t kill my app by tinus_hn on Monday January 14, 2019 @07:03AM (#18902400)
For some basic use cases, like notifications and downloads, there is a special system or api that allows your app to do that in the background without actually running.

If you want to play audio or track gps in the background you need to do things yourself though.

Re:Android vendors, don’t kill my app by simonh on Monday January 14, 2019 @07:55AM (#18902595)
OK, hence the Facebook issue where they played a silent audio track to keep their app active. I'd forgotten about that, thanks.
Re:Android vendors, don’t kill my app by vxNsr on Monday January 14, 2019 @02:38PM (#18905754)
Wow, that sucks is again super user hostile, I'm so happy I removed their app.
Re:Android vendors, don’t kill my app by scarface74 on Monday January 14, 2019 @06:17AM (#18902199)
Technically, you could have an app that plays silent audio in the background to keep from getting killed and then do something else, but that would get flagged by the review process.

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.

Re:Android vendors, don’t kill my app by doubleunplussed on Monday January 14, 2019 @12:34PM (#18904658)
I think they've wisened up to that trick. My girlfriend and I use a guided meditation app that has long silences in the audio. If the screen is off, her phone kills the app after about thirty seconds of silence, making the app practically useless.

I was going to report a bug to the app suggesting they include some ultrasonic or subsonic audio to defeat this mechanism, but it's just an arms race at that point. The phone will start looking at the total power in the audible spectrum to decide whether to kill the app or something.

This kind of thing is infuriating and prevents apps from doing anything outside of the box, stifling innovation and making users frustrated.

Re:Android vendors, don’t kill my app by aaaaaaaaaab on Monday January 14, 2019 @04:56AM (#18901918)
>I don’t think you could implement a tracking socket masquerading as a background download

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

Re:Android vendors, don’t kill my app by toyg on Monday January 14, 2019 @05:07AM (#18901957)
Holy crap, I didn’t know that. Yet another reason I was right to uninstall the app and just use the website.