Binder communication mechanism of Android IPC _android
Source: Internet
Author: User
Binder communication mechanism is simple, but in the use of the process encountered a number of problems, finally resolved, in this summary, together to share with you:
1, to use binder communication, first to define the interface, and then implement the server bninterface*** and client bpinterface***, after all, one is to unpack the parameters, one is to package the parameters.
2, the server should be able to receive binder call request, to have two conditions: one is to implement the BN interface, the other is to invoke ipcprocess ()-"Self->startthreadpool" ()
Ipcthread ()->self->jointhreadpool ();
These two words are very critical, because he started a thread in the background, responsible for reading the binder interface call request, and then call the concrete interface, if not this thread, your service is not receiving the call request, the client will invoke failure (died).
As with the client, if you want to support callbacks, you must also start the thread that reads the binder call, otherwise the callback fails.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.