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
*rot);

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
hack...@android.com

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. AACPlus - Decoding a Stream? - Anyone Shoutcast?

Hello Androids!

So lets get Radio Streaming working! First to those that are experts.
The G1 phone supports AAC file types... but not sure if AACPlus? or
are we talking about the same thing? Do we need decoder support? Is
there any decoder support on the MediaPlayer?

So I was looking into making an ACCPlus V1 or V2 radio stream readable
by the MediaPlayer but apparently it doesn't work...
if I store a few Kbytes of this stream into a file than try to play it
on my computer it works...  If I try playing that file on my G1
phone... no luck...

So at this point I know I'm getting the right data...

Now how do we decode this stream to be MediaPlayer readable on
android? I guess this will get us on the right path to Radio
Streaming...

Thanks
Jona

--~--~---------~--~----~------------~-------~--~----~

2. RingtoneManager URIs

My application offers a preference to allow the user to set the
preferred notification sound. I save that URI and I use it when I have
to play a notification sound. I just noticed that the ringtone URIs
can change over time therefore invalidating the URI that I saved. This
could be because of an application I installed recently which records
sounds. Should ringtone URIs change over time? Should I use the name
of the ringtone to get the URI every time I need to play a sound?
--~--~---------~--~----~------------~-------~--~----~

3. What happened to ADC 2?

4. Need to resolve .APK not found error.

5. Best way to build multi page form

6. How to use oprofile on android?

7. Android T-Mobile "Hotspot" (WiFi) Calling Support