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

标签 android

一个 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/

相关文章:

android - OpenCV for Android - 访问 Mat 的元素

java - Eclipse 显示错误,而 ndk_build 成功

java - Null 对象引用上的 SupportMapFragment#getMapAsync()

android - 我在 Android Q 中将 IMEI 设为空?

java - 检查检查列表中的元素是否已勾选并通过电子邮件发送?

android - 需要 android Activity 等到获得 GPS 位置

android - 在没有用户交互屏幕的情况下授予权限

android比例位图性能

android - GPS 的刷新率 - 什么是可以接受的?

android - ADB 未在 ubuntu 12.04 中检测到设备 samsung i777