Question

I want to know what is the path for the assets folder. I'm using Irrlicht Engine for render the graphics, and as you can see in the following code, I add a Folder File Archive to use the assets in the folder MyGameAssets that is located in the sd card directory.

//Create the irrlichtDevice
device = irr::createDevice(irr::video::EDT_OGLES1,
            irr::core::dimension2d<irr::u32>(screenWidth, screenHeight), 32,
            false, false, false, 0);

//With this path my Game can use the assets in the folder that is on SD card
device->getFileSystem()->addFolderFileArchive("/sdcard/myGameAssetsFolder/");

Whith those lines of code my Android Game works fine, but as I said before, I don't want to use the sdcard/MyGameAssetsFolder/. I want to use the Assets Folder of the Android Project. What could be the possible path? Is there any other solution in order to not to use the sdcard path?

Was it helpful?

Solution

I'm guessing you're following "Android NDK Beginner's Guide" Book tutorial. I am too! and I'm having the same issue you are having.

Seems there's no way pure Native C++ can access the asset folder inside the apk. You have to make your app JNI so with Java you can pass the asset folder path to C++.

But, it seems there's also a way to use the AAssetManager inside android native glue library but I don't know how because there is no documentation about, not even inside the docs folder inside NDK folder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top