使者(轻量级替代AIDL)可用于跨应用程序通信? [英] Can Messenger (lightweight alternative to AIDL) be used for cross-application communication?

查看:161
本文介绍了使者(轻量级替代AIDL)可用于跨应用程序通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个快速的问题:Android的文档说得很清楚,<一个href="http://developer.android.com/guide/topics/fundamentals/bound-services.html#Messenger">Messenger是一种替代 AIDL 的IPC(进程间通信)。他们从来没有明确说,但如果这种延伸到,或者只是在一个应用程序在不同的应用中运行的进程。我强烈怀疑前者,但要检查。

A quick question: the Android docs say very clearly that Messenger is an alternative for AIDL for IPC (inter process communication). They never explicitly say though if this extends to processes running in different applications, or just within one app. I strongly suspect the former, but wanted to check.

谢谢! 扬

推荐答案

AIDL是唯一真正用于跨应用程序的IPC。虽然可以使用AIDL进行内部沟通,不买你的东西,并把你的文件夹实施限制。

AIDL is only really used for inter-app IPC. While it is possible to use AIDL for internal communication, it doesn't buy you anything and puts limitations on your Binder implementations.

此外,一个应用程序不会有一个以上的过程中,案件的绝大多数。有什么理由对大多数应用程序有多个进程。

Moreover, one application does not have more than one process, in the vast majority of cases. There is little reason for most apps to have multiple processes.

使者 createPendingResult() ResultReceiver ,私人广播意图 - 所有这些办法让一个服务跨进程边界与客户进行沟通。

Messenger, createPendingResult(), ResultReceiver, private broadcast Intents -- all of these are ways for a service to communicate with a client across process boundaries.

这篇关于使者(轻量级替代AIDL)可用于跨应用程序通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆