Create AILD interfaces

Main interface as well as its callback

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

// 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);
}
// 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);
}

Last updated