gpt4 book ai didi

android - 一个 Android 应用程序中可能有多少个进程?什么是最大计数?

转载 作者:行者123 更新时间:2023-11-29 23:25:41 26 4
gpt4 key购买 nike

一个 Android 应用程序中可能有多少个进程?

我们可以在android中使用manifest添加多个进程。什么是最大计数?

最佳答案

根据来自 here 的 android 文档:

By default, every app runs in its own Linux process. The Android system starts the process when any of the app's components need to be executed, and then shuts down the process when it's no longer needed or when the system must recover memory for other apps.

this :

By default, all components of the same application run in the same process and most applications should not change this. However, if you find that you need to control which process a certain component belongs to, you can do so in the manifest file.

The manifest entry for each type of component element <activity>, <service>, <receiver>, and <provider> supports an android:process attribute that can specify a process in which that component should run. You can set this attribute so that each component runs in its own process or so that some components share a process while others do not. You can also set android:process so that components of different applications run in the same process—provided that the applications share the same Linux user ID and are signed with the same certificates.

The <application> element also supports an android:process attribute, to set a default value that applies to all components.

我们可以发现每个android应用默认都有一个进程。此外,通过在单独的进程中运行每个组件,进程数将等于 NUMBER_OF_COMPONENTS + 1在最大值没有关于每个 Android 应用程序的最大可能进程数的文档。

关于android - 一个 Android 应用程序中可能有多少个进程?什么是最大计数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53598567/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com