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. Is there a time limit I must wait between uploading updates to a single app?

I uploaded an update to one of my apps.  I caught a bug in testing
shortly after.  I noticed that the Upload Upgrade link had
disappeared, and I only have the ability to completely remove the
application.  I uploaded the last update yesterday, so it has been
about 15 hours.  I'm guessing there is a 24 hour waiting period so
that you don't flood the market with updates, but I can't find
documentation to confirm.

-- 

2. Is a CursorAdapter only useable for ListView ?

Hello,

I'd like to append childs to a custom AdapterView<CursorAdapter> to
fill it with data.
Can anyone help me to understand how this works? In the docs I read:

"Adapter that exposes data from a Cursor to a ListView widget"
(from: http://developer.android.com/reference/android/widget/CursorAdapter.html)

I understand how to implement the newView() and bindView() methods in
CursorAdapter,
but how do I have to implement the lower 2 of these methods in
MyAdapterView:

MyAdapterView extends AdapterView<CursorAdapter> {
...
@Override
public void setAdapter(CursorAdapter adapter) { // called this in
constructor to set the adapter
        this.myAdapter = adapter;
}
@Override
public CursorAdapter getAdapter() {
        return myAdapter;
}
@Override
public View getSelectedView() {
        // WHAT TO DO HERE ?
}
@Override
public void setSelection(int position) {
        // WHAT TO DO HERE ?
}


Best Regards,
cody

-- 

3. Why is my application suspended

4. Spinner. disabling does not provide any visual indication

5. Intent Filter by protocol specifier

6. <uses-feature> for groups of items

7. Can I use the linux built system.img file in windos sdk