Messenger 类的使用是否取代了 AIDL 服务

发布于 2024-10-05 09:54:20 字数 354 浏览 0 评论 0原文

Messenger 类是构建和构建 AIDL 的替代品吗?使用远程服务 如果是这样,Messenger 是否会处理与处理程序消息的自定义命令关联的方法的线程安全性?当然不, 并且服务跟踪哪个客户端需要哪个方法(线程安全方法),但是 远程服务示例 http://developer.android.com/reference/ android/app/Service.html#RemoteMessengerServiceSample 让我很困惑?

Is Messenger class an alternative of AIDL in building & consuming remote services
and if so does messenger handle thread safety for methods i will associated with custom commands of the handler messages? sure no,
and the service keep track which client needs which method (thread safe methods)but the
sample here for remote service http://developer.android.com/reference/android/app/Service.html#RemoteMessengerServiceSample
made me confused?

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

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

发布评论

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

评论(1

丿*梦醉红颜 2024-10-12 09:54:20

Messenger 类是 AIDL 的替代品吗?使用远程服务

在某种程度上,是的。这有点像问划艇是否可以替代游艇。

如果是的话,Messenger 是否会处理我将与处理程序消息的自定义命令关联的方法的线程安全性?

HandlerhandleMessage() 方法将在主应用程序线程上调用。

Is Messenger class an alternative of AIDL in building & consuming remote services

To an extent, yes. It is a bit like asking if a rowboat is an alternative for a yacht.

if so does messenger handle thread safety for methods i will associated with custom commands of the handler messages?

The handleMessage() method of your Handler will be called on the main application thread.

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