Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Complex types from a remote service to an application through AIDL

Tags:

android

aidl

Ideally I would like to send an object of type

 ArrayList<ArrayList<ASimpleClass>> 

from a remote service in one APK to an application in another. I'm not sure if this is even possible as the API demo code suggests that it isn't:

/**
 * This demonstrates the basic types that you can use as parameters
 * and return values in AIDL.
 */
void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
        double aDouble, String aString);

whilst the autocomplete for writeTo/readFromParcel suggests that other types are an option (though read options don't match write). I would settle for just ArrayList if necessary. If it is possible, I'd much appreciate a pointer to some sample code, or a way to cast the above types into something acceptable to the remote interface AIDL. Can anyone shed any light on this question please?

like image 684
NickT Avatar asked Jan 02 '26 07:01

NickT


1 Answers

http://developer.android.com/reference/android/os/Parcel.html

If what you want isn't on the list of supported methods, you can still send it provided that you write code to dump it out to a series of supported types and rebuild it on the other side.

like image 177
Chris Stratton Avatar answered Jan 04 '26 05:01

Chris Stratton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!