Using Eclipse and ADT, working with AIDL files is very simple: When AIDL files are created or imported into the
src/ folder, the ADT plugin automatically generates the interface definitions and stubs in the
gen/ directory as part of the build.
For example, to generate the
IPackageStatsObserver interface and stub for the code used in Android Package Size:
- Download the AIDL files for
- Create a new java package
- Copy or import both AIDL files to the new package
- The ADT plugin will generate the
IPackageStatsObserverinterface and stub automatically in
The Android SDK also includes a (command line) compiler
aidl (in the
tools/ directory) that you can use to generate the java code in case you don’t use Eclipse.