I want to have a shared memory block (an ashmem region) that\'s mapped and accessed from native code. I also want this block to be used by several applications.
There is a method in helper library libnativehelper.so for this jniCreateFileDescriptor() https://android.googlesource.com/platform/libnativehelper/+/jb-dev/include/nativehelper/JNIHelp.h. It basically does the same thing as stated in previous answer but you might find this approach a bit cleaner.