In case of callback AIDL, in addition to ICalculator.aidl file, we also need to create another ICalculatorCallback.aidl
// ICalculatorCallback.aidlpackagecom.tejpratapsingh.aildlib;importcom.tejpratapsingh.aildlib.ICalculatorCallback;// Declare any non-default types here with import statementsinterfaceICalculatorCallback { /** * Demonstrates some basic types that you can use as parameters * and return values in AIDL. */voidonAdded(int result);}
// ICalculator.aidlpackagecom.tejpratapsingh.aildlib;importcom.tejpratapsingh.aildlib.ICalculatorCallback;// Declare any non-default types here with import statementsinterfaceICalculator { /** * Demonstrates some basic types that you can use as parameters * and return values in AIDL. */voidregisterListener(ICalculatorCallback cb);voidunRegisterListener(ICalculatorCallback cb);voidadd(int a,int b);}