两个具有相同共享和流程的Android应用程序

发布于 2025-02-12 22:55:54 字数 144 浏览 1 评论 0原文

我有一个有关具有相同Android的Android应用程序的疑问:SharedUserid和Android:Process属性。

您能告诉我,我们什么时候应该在共享过程中使用应用程序,如何在该过程中访问其他应用程序上的数据?

I've got a question about android applications with same android:sharedUserId and android:process attributes.

would you please tell me, when should we use applications in the shared process and how can we access data on other application in that process?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酷到爆炸 2025-02-19 22:55:54

android:shareduserid - 现在已经弃用了,您应该避免使用此功能

我们何时应该在共享过程中使用应用程序

理想的整个应用程序过程不应与其他应用程序共享,并且也不会有太多用例
应该制作诸如活动/接收器等的Android组件在单独的过程中运行,而不是申请过程基础,例如我们使用单独的过程来运行FCM服务以减少内存足迹,同时初始化ANR的初始化

我们如何在该过程中的其他应用程序上访问数据

您可以使用Android接口定义语言(AIDL)
https://developer.android.com/guide/components/components/aidl

android:sharedUserId - This is deprecated now, you should avoid using this

when should we use applications in the shared process

Ideally whole application process should not be shared with another application and there won't be much use-cases of it as well
Android components such as Activity/Receiver etc should be made to run in a separate process as opposed to application process basis some use-case, like we used separate process for running our FCM service to reduce memory footprints while initialising reducing our ANR's

how can we access data on other application in that process

You can use Android Interface Definition Language (AIDL) for this
https://developer.android.com/guide/components/aidl

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文