如何阻止应用程序在android操作系统上启动时运行?

在Android操作系统上,是否有必要保持你的启动和运行应用程序列表的精简和平均,如果是这样的话,你如何才能在应用程序繁重的启动上踩刹车?...

如何阻止应用程序在android操作系统上启动时运行?

在Android操作系统上,是否有必要保持你的启动和运行应用程序列表的精简和平均,如果是这样的话,你如何才能在应用程序繁重的启动上踩刹车?

今天的问答环节是由Android爱好者提供的,这是Stack Exchange的一个分支,Stack Exchange是一个由社区驱动的问答网站分组。

问题

Android爱好者读者Scott Severance对驯服自己的Android启动程序很好奇:

When my phone starts up there are several application/services running in the background that I would rather not. And when I press the Home button while using an app, that app usually goes into the background without exiting. How can I stop these apps from running?

解决方法是什么?阻止它们总是最有效的方法吗?

答案

超级用户贡献者Matthew Read提供了一个详细的分类,说明了为什么这一点可能不像Scott认为的那么重要,以及Android在启动应用程序和后台进程方面与其他操作系统有何本质区别:

First Things First

You may have some misconcepti*** about how Android works and what’s really happening when a service is running or an app is in the background. See also: Do I really need to install a task manager?

Most apps (e.g., ones you launch manually) have their current Activity put into the background when you switch to another app or the homescreen. Activities c***ume some memory, so that you can go back to the app and pick up where you left off. Activities are usually not able to run computati*** in the background, so no CPU or battery is used for them. If battery life or CPU performance is your concern, you don’t need to worry about these apps! You don’t need to worry about memory, either; Android will automatically kill the app and free the memory if the system is running low.

If the app in background is running a service, that may be a different story. Well-designed services spend most of their time sleeping, waking up for the occasional check (new social media notificati***, for example). However, poorly designed services may run more often or perform syncing operati*** that you don’t want, affecting battery life and your data usage. If you’ve got a rogue service you may want to try one of the soluti*** below.

Soluti***

If you’re sure you want to make this app stop at all costs, you can try these methods.

Uninstall

When an app does something you don’t like, whether running in the background on startup or something else, your first option is to uninstall it. Problem solved! You can remove system apps if you have root, most easily with Titanium Backup, but be careful to remove only carrier bloatware and not critical system apps.

However, if you want to be able to use that app then this is not an option: keep reading.

Ping the Developer

Some of the greatest daem*** that come with Android are services that run in background for no reason or when a simple interval check with Android’s AlarmManager would be sufficient. We need to kill them all with fire, and not by ignoring them. Everything that does not involve a fix by the developer is just a hack that will result in other negative side effects. If you contact the developer with your problem, they can fix the app and you can go on using it normally. That’s a win for everyone involved.

Manually Killing Apps

First, note that many apps will close completely if you Back out of them rather than using the Home button.

If you are running Ice Cream Sandwich or Jelly Bean, you can go into Settings, hit Applicati***, and manually shut down the app by tabbing over to the running apps. Alternatively you can hit the Recent Applicati*** button and swipe them off the screen to close them. In older versi*** of Android there may be a built-in Task Manager added by the manufacturer to accomplish the same thing, or you can download a task manager app to do so. For services, look at Settings -> Applicati*** -> Services.

WARNING: Do not use automatic task killers! Automatic task killers run in the background (exactly what you don’t want) and kill apps whenever they start. Most of the time this makes things worse, because apps often c***ume more resources when they’re starting up compared to when they’re sitting idle. Services that run automatically and are restarted by the system will be killed over and over, wasting your battery. Similarly, apps that receive system events known as Intents (such as network coverage and connectivity changes) will be killed every time they start up to receive an event. Nothing good can come of it.

A possible exception is automatic tasks that execute only when you, the user, perform a specific action. In essence, they’re just making manual task management easier for you. An app like Tasker or Llama can be used to end activities when you switch apps, for example, ensuring they don’t stay around in the background. Instructi*** for Llama:

Create a new Event. Add the condition called Active App, and choose the status App stopped or in background. Choose the app you want to focus on. Next, add an Action. Select Kill Application (root privileges), then select your app again.

Now, whenever you leave the app, Llama will kill it.

Editing Autostarts and Intents

As mentioned above, some applicati*** may start when they receive Intents (system events). By using an app like Permissi*** Denied you can alter which permissi*** apps can request, which in turn limits which events they can receive. Or you can use an app like Autostarts to edit specifically which Intents will be sent to which apps. For both soluti***, you’ll need root access.

Other opti***:

  • Autorun Manager
  • Gemini App Manager

(Autostarts is free/open-source software, also available from f-droid.)

WARNING: This can cause apps to stop working or inhibit wanted functionality. Proceed with caution, especially with critical system apps.

Freezing Apps

You can use an app like Titanium Backup or App Quarantine to complete freeze apps so that they can’t run at all. If you want to use them you have to un-freeze them first.

WARNING: Do not do this with critical system apps! Your device may fail to boot.

Put Apps into Hibernation

Greenify (require Android 4.0+ and ROOT privilege) use a different approach called “Hibernation”, from traditional “Freezing”.

You can safely hibernate any non-system app you do not want to run stealthily (via persistent services, broadcast receivers, alarms and so on), effectively equivalent to “freezing”, while still keeping all its entrances (launcher icon, sharing target, etc) fully functional when you explictly run itm, without the need to un-freeze it first.

WARNING: Do not hibernate alarm clock apps, instant messaging apps, and other apps whose basic functionality relies on background mechani** (timer, system events, “push”, etc) to work.

The Bottom Line

Android is designed to take care of app management for you. In all but the most extreme cases, you shouldn’t need to worry about it. When there is a problem, we advise you to go for the simplest solution — uninstalling. All other soluti*** are hacks around what Android is designed to do. Maybe one day Android will have official support for managing services but, until then, be careful.


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

 

 

  • 发表于 2021-04-11 17:35
  • 阅读 ( 313 )
  • 分类:互联网

你可能感兴趣的文章

这是让你的android设备根目录的最好方法

植根(Rooting)是一个允许系统级访问某些应用程序和实用程序的过程,长期以来一直是Android爱好者和超级用户体验的一部分。 ...

  • 发布于 2021-03-14 03:22
  • 阅读 ( 362 )

你还需要根你的android手机吗?

...悖的。扎根使您能够使用像FlashFire或ROM管理器这样的flash应用程序,而定制ROM通常是预先扎根的。 ...

  • 发布于 2021-03-14 22:47
  • 阅读 ( 214 )

如何让android更快:什么有效,什么无效

...屏幕重画”的东西。当你从一个像Chrome这样的内存密集型应用程序中切换出来时,你会看到一个完全空白的主屏幕,需要等待几秒钟,而你的图标、小部件和墙纸都会重新加载。保持主屏幕整洁以避免这种情况。 ...

  • 发布于 2021-03-24 04:03
  • 阅读 ( 208 )

如何停止在chrome中自动播放flash和html5视频

... 如果您在Windows、macOS、Linux或Chrome操作系统上使用Chrome,则需要通过Chrome标志的隐藏调整来访问此设置。这些都是Chrome的深度设置,除非你知道去哪里找,否则不可用。 ...

  • 发布于 2021-03-24 08:53
  • 阅读 ( 259 )

如何在Chromebook上安装windows程序和游戏

现在所有新的Chromebook都运行Android应用程序,让我们把目光转向运行PC程序。有了一个叫做CrossOver for Chrome操作系统的新应用程序,你可以在Chromebook上安装几个Windows软件。 ...

  • 发布于 2021-03-26 11:05
  • 阅读 ( 381 )

如何设置和使用最好的android防火墙:afwall+

...oid设备,每天也会与谷歌联系900次左右,你安装的大多数应用程序每天都会记录和发送关于你和你的习惯的信息。 ...

  • 发布于 2021-03-29 05:56
  • 阅读 ( 698 )

如何通过轻触android手机的背面来执行操作

手势和快捷方式允许您快速访问内容,而无需跳转应用程序和菜单。如果你可以轻触**的背面来执行一个动作呢?我们将向您展示如何在Android**上执行此操作。 有几件事你需要开始。首先,你必须有一个运行android7.0或更高版本...

  • 发布于 2021-04-01 13:30
  • 阅读 ( 179 )

mac应用程序未启动?下面是如何修复它

所以,你下载并安装了一个新的Mac应用程序,结果它拒绝打开。现在,您必须弄清楚这是macOS的问题,是不兼容的问题,甚至是安全威胁。让我们试着解决这个问题并启动那个应用程序。 gatekeeper阻止未签名的应用程序运行 如...

  • 发布于 2021-04-01 21:01
  • 阅读 ( 187 )

运营商和制造商如何让你的android手机软件更糟糕

...软件的范围从有用的,比如三星的一些添加了独特功能的应用程序,到无用的,比如一些可以单独下载的愚蠢游戏。 不管预装软件有多有用,这个软件占用**空间的问题很大。该软件安装在系统分区中,在那里你通常无法删除它...

  • 发布于 2021-04-06 22:11
  • 阅读 ( 185 )

当你的运营商阻止android的内置系链时,如何使用它

...过此错误的选项。你可以使用像PdaNet+这样的第三方拴绳应用程序,而在许多**上,一个小小的janky就可以做到这一点。不过,如果你是根用户,你有一个更好的选择:重新启用Android内置的热点功能。 不幸的是,解决方案不是“...

  • 发布于 2021-04-07 06:15
  • 阅读 ( 164 )
lqnig6754
lqnig6754

0 篇文章

相关推荐