Giter Club home page Giter Club logo

Comments (16)

petrnalevka avatar petrnalevka commented on June 20, 2024 6

If you have a bad citizen app which behaves improperly since the very first Android versions you could have simply uninstall it. Since Honeycomb you can force stop such apps and this will prevent any background processing of the apps. And since Pie you can - ONLY DO IT IF YOU KNOW WHAT YOU ARE DOING - restrict their background processing.

The problem with high pooper score vendors on this site is they restrict any background processing by default. So no alarm clock, no sleep tracker, no automation app or simply anything doing something without your active interation will work unless you do special settings. Apps do not know they are restricted and they have no API to ask for not being restricted. This is ill and only leads to frustration both on the user and on the developer end..

from dont-kill-my-app.

Kylejustknows avatar Kylejustknows commented on June 20, 2024 4

The thing is, you misunderstood the true meaning of "stay alive as much as possible" for the dirty apps.

Giving some examples:baidu apps(Chinese Google) and alipay (Chinese PayPal), or CM cleaner, those apps register themselves as fake "alarm" so they can wake and popup ads time to time, and registered to run when screen on/off, and run when wifi connect, and register as accessibility so they have more controls, and cross excuted by using multiple apps so they wake each other up, and asking for drawover permission so system won't actively shut them down, and release and side-excute a binary service to protect themself from being forced close ...

There are dozens ways to bypass the "Doze" and dirty apps undermine all the methods! Nowadays some apps even find a way to workaround "Greenify"- they got forced stopped and few minutes later they are awake again and popping notification ads (considering eg. Alipay got more than a billion users, each ad popup worth millions of dollars, yea they are very motivated to be "anti-kill", and they employed the top developers doing the job)

That's why some more advanced and more aggregative tools like "Brevent" are getting popular. People are working really really hard to "completely kill" the apps after they are closed.

Users are complaining Google for leaving too many loopholes in android to let go of those dirty apps. I think Google is just too kind-hearted that they don't see how evil some developers can become. Luckily the phone companies realise the problem and step in when they make their roms. Thanks god!

Apps should be completely closed once user close them, unless it's like an alarm app that it should only be able to wakeup when user manually permit it to run in the background. Not another way around.

from dont-kill-my-app.

ol-v-er avatar ol-v-er commented on June 20, 2024 4

I don't think the point is to know if killing apps is a good or a bad idea. If a certain manufacturer helps users avoiding too many notifications...
Android documentation describe a certain behaviour for background tasks. All Android phones should respect those rules.
No manufacturers should modify the Android rules. If every manufacturer does that, Android app development will became a nightmare.

from dont-kill-my-app.

rzetzsche avatar rzetzsche commented on June 20, 2024 3

I think all the discussion is going in the wrong direction. From my perspective the whole point is the following:

Most Chinese vendors are limiting the capabilities of the Android OS. This capabilities should be guaranteed on all Android devices with the same Android version. So for example the AlarmManager functionalities should be consistent on all devices. But because of this shitty device manufacturer background killing, apps won't behave the same on all Android devices. And that's crap! All apps should work as intended on all devices across the world and the reference should be the nexus or pixel lineup. How would you react if tools won't work the same way on all MacOS/Windows/Linux devices across the world? It would be a nightmare and on Android it is already a nightmare.

If Chinese market is fucked up like described, then I understand the reason to do that. But why should the whole world experience such an "Android experience" when the circumstances aren't the same?

Yes there are misbehaving apps but in the western market not in the same magnitude than in china (derived from the previous discussions). Device manufacturers also hide those settings pretty well and the whitelisting process is done in a different way depending on the device manufacturer, or worse, depending on the device manufacturer and their "custom android" version (e.g. EMUI 7/8/9).

TL;DR
Android API's should work for all Android devices across the world. We should blame massively vendors who are cutting down functionalities of Android API's based on their market.

from dont-kill-my-app.

rzetzsche avatar rzetzsche commented on June 20, 2024 3

@Kylejustknows Android is designed to run apps in the background and the real multitasking has it's pros and cons. It's a core principle since Android was released and a main differentiation point from other competitors. No device manufacturer nor custom rom builder should change that because of personal feelings. You'll get a lot of inconsistencies across devices. If you don't want real background processing please buy an iPhone and you will be happy.

I have nothing against a real background permission, this would be controllable. But this whole China vendor fuck up isn't. I think the whole foreground service permission and the way you must start a foreground service should do it pretty much.

from dont-kill-my-app.

ttimasdf avatar ttimasdf commented on June 20, 2024 1

I don't think the point is to know if killing apps is a good or a bad idea. If a certain manufacturer helps users avoiding too many notifications...
Android documentation describe a certain behaviour for background tasks. All Android phones should respect those rules.
No manufacturers should modify the Android rules. If every manufacturer does that, Android app development will became a nightmare.

I agree with your point, but I also support OP.

I want to open a new issue addressing this until I found this issue. I'll paste what I wrote previously below.

I'll summerize my point of view.
Developers are breaking the Android rules. It's to the developers' interests. Draining battery ruins the users experience. That's to the vendors' interests. The choice of whether an app be running should be made by user.
The vendors did their best for the majority, leave an option for everyone. I see there no point to blame the OS vendors as bad apps are infinite and we do not need that much apps running background consistently. So whitelisting is a great solution, for the majority.


I noticed 4 from the top 5 of your bad vendor list are from China. As a Chinese Android user I express my opinions and the root cause of the problem.

Chinese developers obviously have more experience with different situations.

This is a country without GCM and other guidelines from Play Store, most developers (yes, MOST) abusing permissions and background processes for push messages and grab user informations for different purposes. Included but not limited from,

  • watching filesystem for new image creation, so the app could read the screenshot for analytics
  • overlay an 1x1 empty image on top maintaining service connection for push AD
  • play muted music for not get killed.

The users actually, blame the phone vendor that their battery is draining fast than others. That's why Chinese device vendors consistently updating their strategies to cope with bad developers.

This is a matter of trust. And the vendor's answer to the question is: change the rule from blacklist to whitelist.

With default settings, vendors have a builtin list of most-used app package name like WeChat, Facebook or some other IM, mail apps that should be kept alive. The others are killed when not running, keeping most users experience and battery life at the same time.

So you as a developer should not blame the vendors, but your counterparts. There is a similar campaign in China facing developers called Android Green Application Convention started by the author of Greenify, an app cleaning misbehaved background processes as you hated.

#31

Hello, this is good idea. But unfortunately at the moment do not know about a single vendor where you could detect this directly, so this section would be truly virtual.
On stock Android you can find out that battery saver is running, but I don't this this has direct effect on background processes anyway. You can see if app is or is not optimized on stock Android..
But for other vendors you would need to run a detection background process.. run something for quite a long time when not on charges for instance and see if it runs all the time..

Some solutions exists already. From my experience, the best you could do is to set a flag somewhere in the app's persistence storage indicates the process running, and clear the flag if app is shutdown properly. If your app is killed by OS, you could detect it at next launch and give user instructions to disable battery optimizations differenciates per vendor. EVERY vendor you hated have an option to whitelist an app. And the choice should always be made by the users. Sleep as Android and other apps works well on my MagicUI (Chinese variant of EMUI) and HydrogenOS(Chinese variant of OxygenOS) for years, never lose any alarms or notifications.

Changing the world begins with changing yourself.

from dont-kill-my-app.

p0358 avatar p0358 commented on June 20, 2024

This, especially true for ROMs like MIUI, which has excellent features related to battery saving (unfortunately ROM itself suffers from other performance issues, but that's a different topic), which let you block badly-behaving apps that don't understand you don't have your whole phone just to use them and only them.
Good eamples of such in western world are Facebook apps, I turned the options to disable them in background and my phone is working much better that way (I swipe the app to the side in recent apps list and it then really gets closed, because MIUI prevents it from instantly reopening 5 background processes).

from dont-kill-my-app.

DeweyReed avatar DeweyReed commented on June 20, 2024

People in phone company do "Kill App" for a reason, a good reason.

There is a reason but not always a good reason as far as I experience. Many of them are too lazy to tell which app is draining the battery and simply kill all apps aggressively.

There're bad apps finding all kinds of ways to keep themselves alive. Is this the excuse for killing every app on your phone? Definitely not. What those phone companies should do is to create better algorithm to find out those bad apps instead of killing everyone.

Maybe this project shouldn't go too far in case those bad apps take advantage of it and take charge of users' phone.

from dont-kill-my-app.

Kylejustknows avatar Kylejustknows commented on June 20, 2024

If there is an algorithm to tell which app is good, the dirty apps will soon exploit the algorithm and behalve accordingly to get "always alive".

Build-in "Doze" has this algorithm, as if an app is doing x/y/z it will not be freezed. And all dirty apps are taking advantage by pretending doing x/y/z to keep alive.

There are millions of dollars in line if the app can survive even a bit longer. Seeing some apps using all kinds of sneaky tricks to bypass Doze, Amplify, Greenify...., I know there are top notch system researchers (or hackers)working hard to exploit all the vulnerabilities to keep their apps alive. And they sit in the office in big and rich companies.

Sadly some of the tricks of "keep alive" involve some sorts of hooking on kernel wake-locks making the phone "awake" all the time, consuming lots of battery. Well they don't really care about it as long as their app is still running in background.

And the trend is getting worse. Eg. when Uber vs DiDi in Chinese taxi market, DiDi pops up dozens of ads everyday on every corner of my phone, showing how good DiDi is/ giving bonus money for next ride/ remind me don't forget to use DiDi today/ fun stories just happened on the road/ good looking and sexy girl pics of whom just used DiDi service near me etc.etc. and Uber......er.... Is awkwardly clean and quiet, it quit itself, and they soon lose the battle. This is how things work in some countries. All the apps are getting dirtier to survive. Earlier days those apps even do automatic freeze and uninstall competitors apps.

The only solution before AI kicks in is the user hand-picked whitelist. And this is failing too.

Now I see some apps start to warn me that "it appears our app is not on your phone whitelist, it may behalve malfunction" in Chinese, when the dirty app's "smart algorithm" detect itself being regularly freezed/killed in the background it warns me. I think soon enough it will become "refuse to run" until user whitelist the dirty apps.

So stop dreaming some algorithms can fix this issue. The dirty apps can out-smart them easily. In some places ppl are counting on the phone build-in / Brevent whitelist so their phone won't blow up. Some ppl are using even more aggressive sandbox like auto install-run-uninstall to keep phone clean (some dirty apps can not be terminated even by using all those tools. Some new system loopholes exploited or the phone manufacture is paid to give them special access I think)

from dont-kill-my-app.

yccheok avatar yccheok commented on June 20, 2024

See, the whole point is, such vendor's solution only fit in chaotic China market, not rest of the world.

In rest of the world, Google already enforces all app targetting API 26. We, developers don't need vendor's to step in, to break the thing.

Google should really have some rules for vendor like: If you want to have Google Play Store pre-install in your phone, you may not use your own battery optimization policy.

from dont-kill-my-app.

Kylejustknows avatar Kylejustknows commented on June 20, 2024

See, the whole point is, such vendor's solution only fit in chaotic China market, not rest of the world.

In rest of the world, Google already enforces all app targetting API 26. We, developers don't need vendor's to step in, to break the thing.

Google should really have some rules for vendor like: If you want to have Google Play Store pre-install in your phone, you may not use your own battery optimization policy.

yccheok, so you are saying like "because I am not in China, I can trust all the developers"?

btw there is a funny thing:
image
Now this is even more extreme as the graph is back to 2017.
So basically, phone apps = china, only china, almost.
If your phone has some English apps, you are the minority in the world lmao.

Back to the topic, sometimes I see English-based apps locked-up and pop junks as well, because the "ads module" they used is dirty. (eg "jetpack joyride" that game app can bypass doze etc. always running consuming resources and popup daily ads notifications and it is a b**** to kill)

Most phone vendors provide settings option to turn off the background-kill (see on Oneplus, OPPO Samsung, Vivo. It is just sometimes a bit tricky to turn it off eg. on OPPO phone the settings is in the "Security Center" APP thats a system app on that phone)

But I agree with you that when the phone is for sell in "clean countries" the function should be an opt-in, instead of turnon by default.

from dont-kill-my-app.

yccheok avatar yccheok commented on June 20, 2024

No! This is not the point I want to bring. (Trust developer)

What I want to bring is, Google controls the distribution channels (Google Play store), and can effectively (almost) eliminate bad apps. We, developers, don't need phone vendors to involve. When phone vendors involve, that is a chaos for both end users and developers.

from dont-kill-my-app.

Artaud avatar Artaud commented on June 20, 2024

@ttimasdf
Big thanks for those valuable insights!

I see that the main breaking point is that not all of the vendors provide a way to whitelist your apps. For example with Nokia, it simply does not do anything, in unspecified cases.

Sometimes, they will provide a way to whitelist the apps, but the discoverability sucks or is nonexistent - they do not document or hint at it anywhere, as it is with OnePlus - they have two different mechanisms of background limitations, each with its own whitelist, but the user has no chance to discover it, there are no hints and no feedback.

from dont-kill-my-app.

Artaud avatar Artaud commented on June 20, 2024

@ttimasdf We totally stand behind the latest Android policies, which forbid invisible background processes, force every service to be foreground, show notification and have a STOP button on itself.
This is the way it should be done and IMHO should be enough even in such tough environment as China.
All of those evil practices you've mentioned are impossible in the Google Play ecosystem now thanks to those rules.

With default settings, vendors have a builtin list of most-used app package name like WeChat, Facebook or some other IM, mail apps that should be kept alive. The others are killed when not running, keeping most users experience and battery life at the same time.

A whitelist controlled by the vendor is a really bad practice. Android is not iPhone, the phone is yours and should be yours. You as a user should be able to do what you please with it. Any whitelist that is not controlled by the user will always be outdated in principle.

Regarding Greenify, that's something completely different - the user had to voluntarily install it on his phone and has complete control over what it does. He can stop it, uninstall it, exempt apps from it, whatever. It shifts the responsibility to the user, which in my opinion is the right thing.

from dont-kill-my-app.

Kylejustknows avatar Kylejustknows commented on June 20, 2024

@rzetzsche As a handhold device with limited battery, the policy or "capabilities" should be:
No app is allowed to run secretly in background, Apps should shutdown as soon as user close it (like desktop OS), unless its an important app eg. alarm clock then user can give it special permission to run in background.

Vendors are simply trying to correct google's fault. (I still don't understand why its designed to be so hard to terminate an app completely in android system. People close it, people want it to be gone, simple like that)

@Artaud The new policies you stand behind failed. Dirty apps are creating 1x1 pixel transparent screen filter to stay "foreground". Dirty apps keep playing a "mute song" pretending as a music player to stay alive. I bet you there are hundreds way to walk around the policies. when there are policies, there are exploits.

Vendors would like to kill all the background apps (so users won't keep feeding-back bad battery life), but then a new issue comes: There is no universal working "Background Allowed" permission thing build in android system (again, google's fault) and the vendors whitelist settings are in a mess. Many users don't know how to whitelist their alarm/facebook/wechat etc. causing them to miss the important alarms. So vendors have to whitelist those "known good" apps by default.

As a custom rom builder myself, I fully understand it is a mess. But if you think there is a better way, please reply.

from dont-kill-my-app.

Artaud avatar Artaud commented on June 20, 2024

The new policies you stand behind failed. Dirty apps are creating 1x1 pixel transparent screen filter to stay "foreground". Dirty apps keep playing a "mute song" pretending as a music player to stay alive. I bet you there are hundreds way to walk around the policies. when there are policies, there are exploits.

@Kylejustknows please correct me if I'm wrong, but according to the new policies this precisely is not possible anymore, as I've mentioned in #6 (comment)
Those cases will need to display an in-your-face foreground notifications.

Apps should shutdown as soon as user close it (like desktop OS), unless its an important app eg. alarm clock then user can give it special permission to run in background.

I kinda agree on that, in the sense that the user should have control over what's running and what's not.
But the user expectations of desktop and handheld are vastly different. Users don't expect to micromanage apps' memory footprint. One of the core principles in Android is that the memory is managed by the system for you.
So yeah, that's what all of these issues stem from, but I'm not sure that abandoning the automatic memory management concept entirely would be a wise move.

There is no universal working "Background Allowed" permission thing build in android system (again, google's fault)

There isn't, but the battery optimization whitelist in stock Android comes close. There are exceptions where even this whitelist wouldn't help (like when you need to wake up the phone more often than once every 15 minutes to do your job - anyone snoozing alarms?).
But sticking a random battery optimization on top of that is just making mess.

from dont-kill-my-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.