Search code examples
androidfileandroid-ndkjava-native-interface

How to pass file descriptor from UsbDeviceConnection to native code on Android?


According to the docs http://developer.android.com/reference/android/hardware/usb/UsbDeviceConnection.html#getFileDescriptor() returns file descriptor which can be used in native code. How can i pass it to native code (as to child process or via JNI)?


Solution

  • Use UNIX Socket if you want to pass in to child process or just as int via JNI