How to add an API to handle multi int parameters as output in BnInterface and BpInterface

by waterblood » Tue, 28 Apr 2009 07:05:27 GMT

Sponsored Links
 Hi All,

   I just want to add a simple api into current Android framework's
Interface. The API looks like as below:

  status_t getDestRect(int *left,int*right,int*top,int*bottom,int

in which int *left,int*right,int*top,int*bottom,int *rot works as
output parameters.

I checked some implement of BpInterface, they all use
Parcel::writeStrongBinder(const sp<IBinder>& val) to pass down the
memory pointer to Binder. Is that means all input pointers should be
wrapper to a sp<IBinder>? Is it a way to simply wrapper a int *,or
some basic type pointer?

Best Regards
Guoyin Chen


How to add an API to handle multi int parameters as output in BnInterface and BpInterface

by Dianne Hackborn » Wed, 29 Apr 2009 04:21:36 GMT

 If you are adding this to a Binder interface, you can write it as output
parameters -- marshall the results into the reply, and unmarshall them into
the int pointers on the other side.  You can try writing an .aidl interface
with these as [out]int and look at the generated Java code to get an idea of
how you would write it.

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

Other Threads

1. Is there direction of developing to full compatibility linux packages(rpm, deb, tgz, etc...) which already and android?

Hi, everyone!

I mean, some great sandbox, wich will not required root privileges to
install such deb, or rpm whatever, like amarok, zenmap, sudoku...?

Every day market polluted by hundreds clones of true opensource

If there are already linux kernel and userland, and some guys have
install debian on android kernel, maybe some easy way to make such
sandbox by default on android 4.0/3.0, is?

After it, we have Wine, and all windows application there...

And after time any application including bsd's apps in particular mac
os's apps.


2. Please recommend job boards for Android developers

Please recommend job boards for Android developers. Thank you for your


3. Supporting motion jpeg with avi oontainer

4. File buffer help

5. screenOrientation

6. SQLite Issues - Database seems to be corrupt on occasions. Missing tables etc.

7. How to investigate a system crash reported by user?