Android Base--binder Connection pool connection multiple aidl files processing

Source: Internet
Author: User
Tags connection pooling

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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.