Android的广播接收机VS AIDL [英] Android broadcast receivers vs aidl

查看:274
本文介绍了Android的广播接收机VS AIDL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是使用AIDL VS广播接收机,为应用程序之间发送消息(后台和前台处理)的利弊?我一直在使用接收器,这是很好由于订阅模式意图过滤器和易用性/可扩展性。是否有缺点,使用这种方法来VS AIDL?

What are the pros and cons of using aidl vs broadcast receivers for sending messages between apps (for both background and foreground handling)? I've been using receivers which is nice due to the subscription model with intent filters, and the ease of use / extensibility. Are there drawbacks to using this approach to vs AIDL?

THX

推荐答案

我认为一个人拉回可能是电池寿命具有接收器收听不断投入紧张的电池电量。 BroadCastReceivers可以有安全漏洞,如果你也上广播时,除非你的本地广播,那么你可以使用,当然LocalBroadcastManager不重视的权限。

I think one draw back might be the battery life as having a receiver listening constantly puts strain on battery level. BroadCastReceivers can have security holes if you dont emphasis permissions when broadcasting also unless your broadcasting locally then you can use LocalBroadcastManager of course.

AIDL我似乎更安全,但更难抽象为一组中的一般使用。我喜欢AIDL文件时,我有,我想在另一个进程中,使许多不同的API调用。它就像一个遥控器。用Broadcastreciever可能较难直接调用自定义方法做的工作。

AIDL to me seems more secure but harder to abstract for general use in a group. I like AIDL files when i have many different API calls i want to make in another process. Its like a remote control. with a Broadcastreciever might be harder to directly call custom methods to do work.

这篇关于Android的广播接收机VS AIDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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