[mono-android] JNI Help Please

Jonathan Pryor jonp at xamarin.com
Fri Feb 3 19:37:32 UTC 2012


On Feb 3, 2012, at 2:29 PM, digitalml wrote:
> Now how do I convert that JavaArray<byte> cardData to something useful? 

Depends on what "something useful" is. JavaArray<T> implements IList<T>; isn't IList<T> useful? ;-)

If you'd prefer a byte[], you could use LINQ's .ToArray() extension method. Alternatively, instead of creating a JavaArray<T> within n_OnReceiveMsgCardData(), you could instead do:

	byte[] cardData = JNIEnv.GetArray<byte>(n_cardData);

 - Jon



More information about the Monodroid mailing list