The client then communicates with the service through an IBinder interface.
The service must implement the IBinder interface as appropriate.
All code comments included in the.aidl file are included in the generated IBinder interface (except for comments before the import and package statements).
Todos los comentarios del código incluidos en el archivo.aidl se incluyen en la interfaz IBinder generada (a excepción de los comentarios antes de las instrucciones de importación y paquete).
The following section discusses several different ways that you can define your service's IBinder interface. Creating a bound service
Existen algunas maneras en las que puedes definir la interfaz IBinder de tu servicio, y en la siguiente sección se explican cada una de las técnicas.
Declare an instance of the IBinder interface (generated based on the AIDL).
Declara una instancia de la interfaz IBinder (generada según el AIDL).
When you build each application that contains the.aidl file, the Android SDK tools generate an IBinder interface based on the.aidl file and save it in the project's gen/ directory.
Cuando creas cada aplicación que contiene el archivo.aidl, las herramientas del SDK de Android generan una interfaz IBinder basada en el archivo.aidl y la guardan en el directorio gen/ del proyecto.
Simply save your.aidl file in your project's src/ directory and when you build your application, the SDK tools generate the IBinder interface file in your project's gen/ directory.
A continuación, te mostramos un ejemplo de archivo.aidl en el directorio src/ del proyecto y, cuando crees la aplicación, las herramientas del SDK generarán la interfaz IBinder en el directorio gen/ de tu proyecto.