how to access assets directly in android NDK - cocos2d-x
-
25-10-2019 - |
Pergunta
I want to read some json files in android ndk ! problem is i could not find any tutorials that describe direct access to assets in ndk (most of them say i should pass pointer from java code to native but i cant use that )
I also tried to find some example about <android/asset_manager.h>
but again no luck!
Solução
Copy FileOperation.h and FileOperation.cpp into cocos2d-x/HelloWorld. Invoke FileOperation::saveFile() and FileOperation::readFile() in HelloWorld::init(). Modify cocos2d-x/HelloWorld/android/jni/helloworld/Android.mk.
Rebuild and run
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow