fopen in JNI C code get failed for file placed in assets folder in android application

Viewed 1408

I have kept some files in assets folder of android application.

Now i compile that application and get apk. [when i extract that apk my files are there in assets folder]

Now i install that apk in mobile device

and in That application has some code in c programing with JNI interface.

Now my fopen() call in c programming for that file get failed.

fopen("myfile","r");

I know while installing apk android copy assets file to /data/data/com.packagename/something

So does anyone knows that path so i can give it in fopen()

or is there any other method to open that file in C programming.


If i keep those files in sdcard folder and access like fopen("/sdcard/myfile","r"); then it works file. But i want to keep those files in assets folder only

2 Answers
Related