Back to Comprehensive Rust

AIDL Interfaces

src/android/aidl/example-service/interface.md

latest808 B
Original Source
<!-- Copyright 2024 Google LLC SPDX-License-Identifier: CC-BY-4.0 -->

AIDL Interfaces

You declare the API of your service using an AIDL interface:

birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl:

java
{{#include ../birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl:package}}

{{#include ../birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl:IBirthdayService}}
}

birthday_service/aidl/Android.bp:

javascript
{{#include ../birthday_service/aidl/Android.bp}}
<details>
  • Note that the directory structure under the aidl/ directory needs to match the package name used in the AIDL file, i.e. the package is com.example.birthdayservice and the file is at aidl/com/example/IBirthdayService.aidl.
</details>