1

I have a native app running on Android 5.0, an audio effect actually, that get launched on camcorder recording usecase (for instance). I have an application that needs to retrieve some data from it, 3 integers exaclty, that changes constantly.

How can a share these data from my native process with my application?

What are the options?

I had a look to ashmem but cannot find an example for my case, I tried to write my data to a file and read them with from jni, but when I launch this read function, I dont see any trace of the native function (only the jni itself) and get constant random numbers... (but no crash)

Thanks, Pierre

1 Answers1

1

Have a look at the JNI documentation. There are many functions available for this of the form:

 env->GetShortArrayRegion(currentDim, 0, size, buffer[i]);

You can also pass a long pointer between your Java & C app that points to a native C/C++ structure.

EntangledLoops
  • 1,951
  • 1
  • 23
  • 36