Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pass file across JNI boundary
val target = File(context.getFilesDir(), "my-file")
val fd = ParcelFileDescriptor.open(target, ParcelFileDescriptor.MODE_READ_WRITE).detachFd()
//fd is an int that's ok to be passed to native code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment