Search code examples
androidandroid-ndk-r5

access android external SD card from native code


I'm developing a native apk for android with NDK 5.

My question is, how do I access to write and read from external SD card from native code?


Solution

  • It works the same as Java code.

    You need to use the SDK API Environment.getExternalStorageDirectory() in your Java code and then pass that to your native code, accessing it like a normal path.