Android - accessing files in native C/C++ code with Google Scoped Storage API
问题 I need to open files by file name in Android apps within native C/C++ code. The native code are 3rd party libraries that I would prefer not to modify, but they often require file name as an argument to read/write files. With the Google's "scoped storage" API and disabling native access to files in Android 10 or later, it's a real problem. One well known solution is to get a file descriptor and use "proc/self/fd/FD_NUMER" trick, like: ParcelFileDescriptor mParcelFileDescriptor = null; String