Office Hours — Today, October 22

Yesterday, October 21

Oct 22
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:00 AM
Yaniv
has entered the room
Mark M.
hello, Yaniv!
how can I help you today?
Yaniv
Hi Mark
I have a question about aidl
is it possible to pass an array through AIDL?
Mark M.
do you mean a literal Java array, as in String[]?
Yaniv
more like int[]
or a list
Mark M.
AFAIK both are supported, though they have to be for underlying types that themselves are AIDL-compatible
Yaniv
what does that mean ?
9:05 AM
Mark M.
List<String> should work
List<Restaurant> would only work if Restaurant itself is something that can be passed via AIDL, such as Restaurant being an AIDL-defined interface
Yaniv
View paste
package com.tfl.extprotocolservice;

import com.tfl.extprotocolservice.IParameterCallBack;


// Declare the interface.
interface IParameter {
	void getEvent (IParameterCallBack eventCallBack);
	void askForParameter(int parameter);
	void ask(List<Integer> list);.
in the List line I get an error
"parameter list unknown type"
Mark M.
that may be tied to the Integer more than the List
you would think that it would handle Integer, but possibly it does not
Yaniv
so what kind of lists can it handle?
Mark M.
also, the docs there do not mention support for something like int[], and I have not tried it personally
again, the values in the list have to be something that AIDL could handle individually
so, List<String>, List<CharSequence>, List<IParameterCallback> should be OK
Yaniv
so I can't use a list of integers for that matter
Mark M.
worst-case scenario, create your own ParcelableInteger class
I don't use AIDL much, as I do not use the bound service pattern much, so I have not experimented with many data type combinations
Yaniv
if I create my own class , how will that work?
9:10 AM
Mark M.
anything that is Parcelable can be passed through AIDL
so, ParcelableInteger would be a Java class that holds an int or Integer and implements the Parcelable interface
Yaniv
I see
ok I will try that
thank you
Mark M.
and I see a Google Groups post from 2008 where Dianne Hackborn indicates that Integer itself is not supported
Yaniv
ok..
thanks
9:15 AM
Mark M.
if you have another question, go right ahead -- it is a quiet chat room today :-)
9:30 AM
Yaniv
has left the room
9:55 AM
Mark M.
turned off guest access

Yesterday, October 21

 

Office Hours

People in this transcript

  • Mark Murphy
  • Yaniv