# Why can't I use C routines to load files in Android NDK?

I have successfully rendered a triangle with a hard coded shader using NativeActivity of Android NDK. Now I have the requirement to load a shader file. I tried to use fopen but it is returning NULL.

I have researched a little bit and found out there's an AAssetManager which I can use. I want to know why fopen didn't work and why should I use AAssetManager to load files?

• fopen returns NULL if it can't open the file, probably because you just have the path to it incorrect. – Maximus Minimus Oct 29 '18 at 3:12
• Ya that' correct. But I am pretty sure that's not the issue because I have tried all the possible paths. – Ankit singh kushwah Oct 29 '18 at 3:14