Aidl (1)

Source: Internet
Author: User

Aidl (Android Interface Definition Language)

Description

 Allows cross-process access between Android applications. Using aidl technology means that other applications of the system can access the service components of their own applications. Android supports cross-process access in two ways: aidl and messenger. The difference between the two is that the former can process multiple threads, and the latter can only process single threads. Therefore, thread security must be ensured when aidl is used.

Define remote service interfaces

1.Create the. aidl File(Create an aidl file)

Create an aidl file in the src directory of the project and define the interface in the file.

 



 

2.Implement the interface(Implementation Interface)

Implement the aidl interface in the service class

 

3.Expose the interface to clients(Expose the interface to the client)

 

Method for binding a remote interface object

1. Copy the aidl interface file


2. Bind a remote service


3. Obtain the remote service interface object instance


4. Call the process Service Interface Method


Instance project download link http://download.csdn.net/detail/u010739551/7705575

For more information, see the aidl (2) blog.



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.