android 应用程序在无事可做时退出时是否应该关闭其服务

Should an android app close its service when exit if there's nothing to do

我的 phone(android) 中的某些应用程序在我关闭它们(使用返回键并清除最近的应用程序)后保留了一项或多项服务,因为我可以在我的设置中看到它们->应用程序->运行 选项卡。其中一些应用程序在未打开时显然不需要在后台提供服务 运行,因为它们在关闭时实际上不需要做任何事情,至少我想不出任何理由.这些类型的应用程序可以被视为 "bad" 应用程序吗?或者如果有一些原因,因为我发现它比较常见。

你说得对 我准备了关于这个主题的演示文稿,我发现这是开发人员犯过的最严重的错误。

Leaving a service running when it’s not needed is one of the worst memory-management mistakes an Android app can make. So don’t be greedy by keeping a service for your app running. Not only will it increase the risk of your app performing poorly due to RAM constraints, but users will discover such misbehaving apps and uninstall them.

我在这里找到了很多关于这个话题的东西https://developer.android.com/training/articles/memory.html