Oceanblue
unread,Aug 30, 2011, 4:39:20 PM8/30/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-ndk
Hi folks,
I'm trying to save a byte array to a file, but not successful.
Here is the code I tried
FILE * pFile;
pFile = fopen ( "my.bin" , "wb" );
__android_log_write(ANDROID_LOG_DEBUG, DEBUG_TAG, "opened
file");
if (NULL == pFile){
__android_log_write(ANDROID_LOG_DEBUG, DEBUG_TAG, "null
file pointer");
}
fwrite (barray , 1 , barray_size , pFile );
fclose (pFile);
I get this message in logcat:
"null file pointer"
I do have this permission in the manifest too:
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-
permission>
Any thoughts?