-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2019-04-04:请回答一下Android进程间的通信方式? #21
Comments
RPC采用客户机/服务器模式。请求程序就是一个客户机,而服务提供程序就是一个服务器。首先,客户机调用进程发送一个有进程参数的调用信息到服务进程,然后等待应答信息。在服务器端,进程保持睡眠状态直到调用信息到达为止。当一个调用信息到达,服务器获得进程参数,计算结果,发送答复信息,然后等待下一个调用信息,最后,客户端调用进程接收答复信息,获得进程结果,然后调用执行继续进行。 |
上面讲述的是RPC请把IPC解释一下 |
我们android这边一般比较多的是AIDL, 当然还有其他比如 内容提供者,Socket, message, bundle 目前就想到这几种欢迎补充. |
handlerMessage,broadcast,service,contentprovider,intent等方式都是可以的吧。。。 |
使用Binder主要是通过绑定服务(bindService),服务端,主要是运行Service,客户端通过bindService获取到相关的Binder,Binder就作为桥梁进行跨进程的通信.然后通过handler进行接收消息不过messenger的话,服务端处理客户端的消息是川航的,得一个一个来。也就是说并发量大的时候messenger就不太合适了 |
aidl 广播等,跨进程原理是用binder机制,binder机制是一种cs架构的IPC通信方案,细节请大佬补充 |
进程通讯,Android提供AIDL与Messenger,另外四大组件都支持进程通讯(机制都是Binder),Android进程通讯离不开Binder,另外非Android提供的有socket通讯,eventbus类库之类 |
可使用基于Binder的aidl,广播,provider等方式,也可使用socket,共享内存等linux自带方式 |
eventbus 怎么实现的进程间通信呀。求指教 |
|
不能实现 |
广播 也可以做进程间通信 |
从Linux系统上来说,有Socket、消息队列、管道、共享内存、Binder。理论上,这些都可以实现跨进程。 在Android的本地进程间通信,见识过两种: |
进程间通信 handler是处理不了的,另外几种无外乎基于binder的,在就是socket,文件流 |
Bundle :简单易用 只要用于四大组件间的进程通迅 |
1、管道 |
No description provided.
The text was updated successfully, but these errors were encountered: