Android Development Learn--aidl

Source: Internet
Author: User

Aidl:android Interface definition Language, which is the Android interface definition language.

What is Aidl

There is no sharing of memory between processes in the Android system, so there are mechanisms that need to be provided for data communication between different processes. To enable other applications to access the services provided by the application, the Android system is implemented using remote procedure calls (Procedure Call,rpc). Like many other RPC-based solutions, Android uses an interface definition language (Interface definition Language,idl) to expose the interfaces of the service. We know that 3 of the 4 Android application components (Activity, Broadcastreceiver, and ContentProvider) can be accessed across processes, and another Android application component service is also available. As a result, this service that can be accessed across processes is referred to as the Aidl (Android Interface Definition Language) service. Steps to establish a aidl service It is more complex to establish a aidl service than to build a common service, as follows: (1) Create a file with the extension aidl in the Java package directory of the Eclipse Android project. The syntax of the file is similar to Java code, but slightly different. (2) If the contents of the Aidl file are correct, ADT will automatically generate a Java interface file (*.java). (3) Set up a service class (subclass of Services). (4) Implement the Java interface generated by the Aidl file. (5) Configure the Aidl service in the Androidmanifest.xml file, especially note that the attribute value Android:name in the,<action> tag is the ID of the client to reference the service, which is the parameter value of the intent class.

Android Development Learn--aidl

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.