I am doing Android development in Java, with some native parts (external libraries) written in C++.
I'd like to pass a byte[] from the managed (Java) application to the native (C++) library:
// Declaration for the native method in Java
private native void someMethod(byte[] data);
On the native side, i'd like to use the byte array as arguments to another provided native function.
I've read about a JNI method for converting (copying) the array data into a compatible type (GetByteArrayElements), however that leaves me with a jbyte * type, which is incompatible with the library i am using (The library defines it's own nByte type, which is an unsigned char).
What would be the best option for this scenario?
Should i stick to the method i've described using JNI, and convert the jbyte array type into the appropriate nByte array? any other option?