Jni Get Asset Filepath
I am trying to add two .xml files with initialisation data to the APK of my Android App. In the JNI C++ Code I want to get the path to the files so I can open and read the files. I
Solution 1:
Now how do I extract the two paths to the files?
There is no path to the files. Assets are files on your development machine. They are not files on the filesystem of the Android device. Instead, they are entries in the APK file.
Your choices are:
Figure out how to adapt OpenCV to work with a Java
InputStream
,String
, or something else (so your Java code can still work with assets normally), orUse Java to make a copy of those files on the local filesystem (e.g.,
getFilesDir()
, so OpenCV can work with those copies.
Post a Comment for "Jni Get Asset Filepath"