Copy the following question and answer from Google group, which explains the cause.
Problem:
Gavin Bong wrote:
I'm getting this error when running "ant aidl ".
/Data/projects2008/Android/iteration1/lib/src/org/Android/common/iadunitavailability. aidl: 5 parameter 1: 'advert ad' can be an out parameter, so you must declare it as in, out or inout.
Iadunitavailability. aidl
I have an interface method with signature:
Void gimmeads (advert AD );
What am I missing?
The answer is as follows:
Aidl isn't java. It's real close, but it's not Java.
One thing aidl has that Java doesn't is the notion of "ction" for parameters, which determine what data needs to be copied "on the wire" as objects get passed from the client to the server and back again.
If the advert ad parameter is purely input -- meaning it's data passed from client to server -- You need to declare it in the aidl:
Void gimmeads (in advert AD );
If the advert ad parameter is purely output -- meaning it's data is passed from server to client -- use:
Void gimmeads (Out advert AD );
If the advert ad is both input and output -- the client provides a value, and the server might modify it in ways the client needs to see -- use:
Void gimmeads (inout advert AD );
This is only needed for non-primitive parameters to aidl methods. So if the ad parameter were a float instead of an advert, you wouldn't have passed ed the error.