Is it possible to access the resouce files with the NDK in C/C++?
I would like to use the ANSI-C FILE functions ("fopen", "fwrite" etc.).
In Java I read resource files as follows:
- Code: Select all
InputStream stream = Context.getResources().openRawResource(int ResourceID)
try {
final int size = stream.available();
ByteBuffer buffer = ByteBuffer.allocateDirect(size);
buffer.order(ByteOrder.nativeOrder());
byte[] streamBuffer = new byte[size];
stream.read(streamBuffer);
stream.close();
buffer.put(streamBuffer);
buffer.position(0);
return true;
} catch (IOException e) {
Log.e(TAG, "Could not read raw resource");
e.printStackTrace();
}
BTW: there is somewhere a good NDK API documentation? I can only find the Java docs

