Aidl compilation reports can be an out parameter, so you must declare it as in, out or inout

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.