Under what circumstances would using AIDL to define a service interface be the correct decision (rather than just creating an extension to the service class)?>
AIDL
The Android Interface Definition Language (AIDL) allows developers to define a programming interface that the client and server use to communicate with each other using Inter-Process Communication (IPC).
This article shows how to connect to a running service in Android, and how to retrieve the data from the remote/running service.
Example of IPC mechanism
Let RemoteService be a client service and RemoteServiceClient be an Activity to communicate with the remote service.
One service provides information about the mathematic operations like addition, subtraction, and multiplication for the given two integers. To expose the functionality of what Service can do, create an .aidl file in the project directory.
AIDL Example