With version 5 of the NDK, Google has finally included support to access APK from native code without using my "hack" anymore.
I haven't experimented with it yet, but I would recommend looking into it :
http://developer.android.com/reference/ ... ivity.html
(Also see the docs/CHANGES.HTML included in the ndk).
Now, to answer your question, the point of using libzip is not to worry about compression. So you could read your XML file using the same code that I use to read my textures (libzip is used to decompress on-the-fly).
But really, you'd better do it using the official NDK way.
Hope this helps.
Thank you very much for your response!!
I am aware of the new release of the NDK..Unfortunately I am using a modified version of the ndk which currently does not support what I want.
Your example actually does work for me well! I can get the apk and read the included files and also can perform zip_fread() and store contents of the xml file in a buffer!. Well my problem is that I am using a function of OpenCV, cvLoad which takes as an argument the path of the file.
CvHaarClassifierCascade * cascade = (CvHaarClassifierCascade *)cvLoad(filename,0, 0, 0 );
I can not find a way to initialise the cascade from my buffer and therefore I put all my effort in order to find a way to read the file from cvLoad() and not a buffer. I tried to place the xml file also in res/raw and rename it to .mp3 in order to avoid being compressed and skip the zlib functionality.. unfortunately this doesn't seem to work at all..
Can you suggest something?
Anw, thank you very much for your response and from the initial code, it helped a lot!