I am trying to create a small game with android native activity. I wish to load textures using stb image. I don't know how to get the path to assets folder. Is there any API to get path to apk directory so that I can use that to get textures? Thanks.
Reading assets in C or C++ is actually very tricky in Android.
You need to go via the AssetManager, and in Java-side code, you need to do this in your NativeActivity class:
AssetManager mgr = this.getApplicationContext().getResources().getAssets();
And then pass this manager to your C code.
Actually reading assets can be tricky, as it is read from compressed archived, but there is an amazing trick available that remaps the FILE functionality.
Look at android_fopen.h + android_fopen.c on how to do that.
With this trick, you can then
fread() your assets, and have the assetmanager do all the work under water.