I am struggling with this problem. I do not know where to put my file so that it can be visible when installing the apk
char s1[10];
FILE *infile, *fopen();
infile = fopen("/data/data/com.example.hellojni/files/datain.txt","r");
if (NULL == infile)
{
return (*env)->NewStringUTF(env, "***can't find the file");
}
fgets(s1,9,infile);
return (*env)->NewStringUTF(env,s1 );
I have no idea where to put my datain.txt. I put it in the bin folder but it isn't working. I keep saying can't find the file. The path is correct because I print it out on my screen.
Help pls,
Thanks.