> For the complete documentation index, see [llms.txt](https://notes.tejpratapsingh.com/_/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.tejpratapsingh.com/_/android-tips/aidl/aidl-with-callback/create-aild-interfaces.md).

# Create AILD interfaces

In case of callback AIDL, in addition to `ICalculator.aidl` file, we also need to create another `ICalculatorCallback.aidl`

* [x] Create Callback interface

```java
// ICalculatorCallback.aidl
package com.tejpratapsingh.aildlib;

import com.tejpratapsingh.aildlib.ICalculatorCallback;
// Declare any non-default types here with import statements

interface ICalculatorCallback {
    /**
     * Demonstrates some basic types that you can use as parameters
     * and return values in AIDL.
     */
    void onAdded(int result);
}
```

* [x] Create main `aidl` which will register the callback interface.

```java
// ICalculator.aidl
package com.tejpratapsingh.aildlib;

import com.tejpratapsingh.aildlib.ICalculatorCallback;

// Declare any non-default types here with import statements

interface ICalculator {
    /**
     * Demonstrates some basic types that you can use as parameters
     * and return values in AIDL.
     */
    void registerListener(ICalculatorCallback cb);
    void unRegisterListener(ICalculatorCallback cb);

    void add(int a, int b);
}
```
