Android Question Permission error when writing to SD card

Bpick

Member
Licensed User
Longtime User
I'm trying to get this:
B4X:
Dim result As Boolean
    result=MFImage.stringtobitmap2(str,Pathonly,CleanFile)<--- This part works
    Log ("hi")
      File.WriteString(Pathonly,NewFile,str)<--- This part doesn't work
        ToastMessageShow ("All done!", True)
to write to the SD card. This is the error package I receive:

java.io.FileNotFoundException: /mnt/sdcard/DCIM/Camera/0915140908.jpg.bcc (Permission denied)
at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:370)
at anywheresoftware.b4a.objects.streams.File.WriteString(File.java:258)
at b4a.example.main._imageview1_click(main.java:484)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:163)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:66)
at android.view.View.performClick(View.java:2485)
at android.view.View$PerformClick.run(View.java:9080)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3694)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)
at dalvik.system.NativeStart.main(Native Method)
java.io.FileNotFoundException: /mnt/sdcard/DCIM/Camera/0915140908.jpg.bcc (Permission denied)

The error is consistent. BCC is an extension I came up with as a app-specific extension so I know my work.

Any suggestions why I'm getting this?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top