You must have the permission on APK to write the data to sdcard.
please add your permission to <use permission>EXTERAL...</use permission>

2010/11/1 subram <[email protected]>

> Hi ,
> I tried to open a file in my JNI
> /
>
> ***************************************************************************************************************************
> FILE *file = fopen("/sdcard/hello.txt","wb+");
> I put the check as
>
> if(file == null)
> {
> return (*env)->NewStringUTF(env, "oops File Open error !");
> }
> else if(file !=NULL)
> {
> fputs("HELLO WORLD!\n", file);
> fflush(file);
> fclose(file);
> return (*env)->NewStringUTF(env, "success File Opened!");
> }
> returns to the java class
>
> /
>
> ***************************************************************************************************************************
> It prints in the emulator screen as "success file opened",but i wonder
> when i cant able to find the file location in my file system and
> folder. please help in doing file operation properly in JNI.
>
> FYI: i am using android1.5 version as avd and using eclipse galelio in
> linux . Ihad created the SDcard in the window->sdk and avd manager-
> >virtual devices - > new,followed steps to create avd with sd card.
>
>
>
> Regards
> Subram
>
> --
> unsubscribe: 
> [email protected]<android-porting%[email protected]>
> website: http://groups.google.com/group/android-porting
>

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to