如何阻止應用程式在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***:

(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
  • 閱讀 ( 58 )
  • 分類:網際網路

你可能感興趣的文章

3種在linux上模擬android應用程式的方法

如果你是Android的鐵桿粉絲,你可能知道你最喜歡的移動作業系統是從Linux衍生出來的。我們過去討論過Android是如何基於開源元件的,Linux核心就是其中之一。很顯然,如果兩者如此接近,那麼在Linux上執行Android應用程式應該相對...

  • 發佈於 2021-03-11 22:19
  • 閲讀 ( 51 )

如何阻止windows 10在啟動時重新開啟上次開啟的應用程式

... 如何阻止windows 10在啟動時重新開啟上次開啟的應用程式 ...

  • 發佈於 2021-03-12 10:06
  • 閲讀 ( 37 )

每個作業系統如何保證您的安全

...儘可能地保持他們的系統的安全。在iOS下,這叫做越獄。Android的同類產品正在生根發芽。不管他們叫什麼名字,他們都做類似的事情。 ...

  • 發佈於 2021-03-12 11:26
  • 閲讀 ( 42 )

如何在linux上執行虛擬機器:3種不同的方法

...作業系統作為您的Linux虛擬機器,QEMU是最佳選擇。適用於Android、Raspbian或非Linux RISC作業系統的vm,這個基於命令列的工具設定起來很快。 ...

  • 發佈於 2021-03-17 03:13
  • 閲讀 ( 56 )

當你的ubuntulinux電腦無法啟動時,如何修復它

...cOS一樣。在大多數情況下,你可以解決這個問題。下面是如何修復Ubuntu啟動問題。 ...

  • 發佈於 2021-03-18 06:19
  • 閲讀 ( 55 )

如何在chromebook上啟用啟動聲音

傳統上,電腦有一個啟動聲音,一旦啟動和執行就會播放。Chromebooks沒有這種現成的功能,但是如果你錯過了啟動鐘聲的懷舊之感,你可以從設定中手動啟用它。 在Chromebook上,單擊右下角的status部分,以顯示“快速設定”面板...

  • 發佈於 2021-03-31 20:04
  • 閲讀 ( 38 )

為什麼病毒在chrome作業系統上不成問題?

...正祕密在於沙盒。這意味著每個瀏覽器視窗、擴充套件或Android應用程式都在自己的隔離環境中執行,無法訪問系統。所以,如果一個病毒碰巧感染了一個沙盒,其他的一切都是安全的。 chrome os易受攻擊嗎? 不過,病毒只是惡意...

  • 發佈於 2021-04-01 07:31
  • 閲讀 ( 89 )

mac應用程式未啟動?下面是如何修復它

...數威脅。Mac惡意軟體是絕對存在的,只是不像在Windows或Android上那麼普遍。 第三方安全應用程式,如Mac的Malwarebytes,實時執行,並在使用檔案和應用程式時掃描它們。如果您的防病毒不喜歡特定的應用程式,它可能會阻止您開啟...

  • 發佈於 2021-04-01 21:01
  • 閲讀 ( 52 )

如何在chrome作業系統上啟用虛擬桌面手勢

...請檢視我們的指南,使用標誌啟用虛擬辦公桌。 相關:如何在Chrome作業系統上使用虛擬桌面 開啟一個新的Chrome瀏覽器選項卡,並在其Omnibox(位址列)中鍵入以下內容: chrome://flags 按回車鍵開啟旗幟頁,在那裡你會發現各種各...

  • 發佈於 2021-04-02 18:30
  • 閲讀 ( 44 )

如何在chrome作業系統上使用虛擬桌面

... 注意:確保先將應用程式拖到中間。Chrome作業系統模仿Android,當應用程式從側面直接向上或向下拖動時,它就會停止執行。 虛擬辦公桌的快捷鍵即將推出 目前,Chrome作業系統還沒有一種透過觸控板上的手勢或鍵盤快捷鍵在虛...

  • 發佈於 2021-04-03 06:15
  • 閲讀 ( 46 )
lqnig6754
lqnig6754

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦