Reading Resource Files from my own APK in Android Native Environment

前端 未结 2 1499
误落风尘
误落风尘 2020-12-24 15:09

I\'m porting to Android. My existing project has a ton of resource files that I\'m porting into my Android project. I have them all in /res/raw/, and I would like to acces

2条回答
  •  眼角桃花
    2020-12-24 15:41

    If you prevent your assets from being compressed as they are added into your APK then you can use openRawResourceFd() to get a file descriptor, offset, and size and pass them to your native code where you just do an fopen and fseek. On the other hand, if you let the build system compress the files you want to access, you will need to use something like libzip to read them from the APK.

提交回复
热议问题