Binder connection pooling processing of multiple aidl files
Pre-stated:
I am also a beginner, so this article is from a beginner's point of view, if there are inappropriate places please leave a message to teach me, thank you.
If the use of aidl and the binder mechanism do not understand, you can refer to my previous article, theAndroid Foundation-the beginner must know aidl on the application layer of the binder mechanism, http://blog.csdn.net/qq_30379689/ article/details/52253413
Objective:
According to our previous methods of using Aidl, a aidl interface must be satisfied with a service. If our application has multiple modules that require multiple aidl, then multiple service ends are required, service as four components and memory consumption high, which affects the performance of the application. So we need to put all the aidl into a service to manage.
Welcome to follow my csdn blog, hensen_ blog, http://blog.csdn.net/qq_30379689
Binder Connection Pooling Works:
Service-side operations
Step one: Create two modules required Aidl file and create a binder connection pool aidl file, compile Gradle
Step two: Create two modules to the Aidl file implementation class and create a binder connection pool class and implement, old and middle-aged create a server
Step Three: Configure the service in manifests
Step four: Start the service in code
Operation of the client
Step one: Copy the Aidl file from the server to the client, compile the Gradle
Step Two: Write the binder Connection pool code, explained in the code
Step three: Use in code
Step four: Start the server, then start the client, view log, test results
Android Base--binder Connection pool connection multiple aidl files processing