Android10_IPC机制之AIDL机制

============【AIDL工作机理】======================
AIDL给IPC用的;

是用于定义服务器和客户端通信接口的一种描述语言,可以拿来生成用于IPC的代码。

AIDL语言其实是为了避免我们重复编写代码而出现的一个模板。

Android跨进程通信IPC之11——AIDL:https://www.jianshu.com/p/375e3873b1f4

AIDL的使用步骤:https://www.cnblogs.com/chase1/p/7135961.html

AIDL使用详解(讲得不错):https://www.jianshu.com/p/29999c1a93cd

AndroidStudio 使用AIDL:https://blog.csdn.net/u012532559/article/details/52764282 //简单介绍AIDL的使用

AndroidStudio实现AIDL : https://www.cnblogs.com/chase1/p/7135961.html

Android中使用AIDL时的跨进程回调—Server回调Client:https://blog.csdn.net/songjinshi/article/details/22918405

Android studio 上使用aidl总结: https://blog.csdn.net/sawtear/article/details/51899794 //这个讲得不错,分析了stub

AIDL使用学习(二):跨进程回调以及RemoteCallbackList: https://www.jianshu.com/p/16077065fe89 //分别用单个回调和回调列表进行了回调。
android aidl通信 RemoteCallbackList客户端注册回调:https://msd.misuland.com/pd/3255818066314924322 //很好分析了messager和aidl。in out关键字

AIDL的使用、传递复杂对象以及回调客户端: https://www.jianshu.com/p/bc59061cc6fd //也不错

AIDL回调:
AIDL的反向过程。服务端需要客户端提供AIDL供服务端回调。

客户端需要注册回调函数,服务端调用回调函数。

问题:客户端如何获知被回调了,

AIDL实际上是对Binder机制的封装。Binder是进程间通信的机制。

AIDL使用中常见问题:https://blog.csdn.net/weixue9/article/details/80833959

=================【BinderPool】=====================
AIDL有个问题就是,当多个业务模块都需要通过AIDL来进行进程间通信,就要创建10个Service来应对。

这会导致Service太多,Service本身就是系统资源。

为了解决上述问题,需要减少Service数量,让所有AIDL都放在同一个Service中去管理。


BinderPool服务端发现的治理工具:https://www.cnblogs.com/mantoudev/p/8228011.html

Binder连接池:https://www.cnblogs.com/rookiechen/p/5382960.html

IBinder:
iBinder的解释(讲得不错):http://blog.sina.com.cn/s/blog_8d13a22b0100upog.html

IBinder接口是对跨进程的对象的抽象。普通对象在当前进程可以访问,如果希望对象能被其它进程访问,那就必须实现IBinder接口。IBinder接口可以指向本地对象,也可以指向远程对象,调用者不需要关心指向的对象是本地的还是远程。

什么是IBinder:http://www.sgyma.com/hhlm_49226.html

Binder是一个类,它实现了IBinder接口,而IBinder接口定义了与远程对象的交互协议。通常在进行跨进程通信时,不需要实现IBinder接口,直接从Binder派生即可。

Binder和AIDL的关系:https://blog.csdn.net/daihuimaozideren/article/details/79456953

猜你喜欢

转载自www.cnblogs.com/grooovvve/p/12462805.html