I try to load a .mat
file in Android 4.4, using JMatIO.
It worked well when the .mat
file was in external storage, but it didn't work when the file was in the app's raw
folder. Currently, the application can not find any *.mat
files. The log just prints the message, "fail to load matrix file".
Below is the code I'm using:
try {
mfr = new MatFileReader("android.resource://" + getPackageName() + "/raw/rm.mat");
} catch (IOException e) {
e.printStackTrace();
Log.d(TAG, "fail to load matrix file");
System.exit(0);
}
if (mfr != null) {
Log.d(TAG, "Success to load matrix file");
}
How can I load the file successfully?