Android Question [Solved] Problem with File.copy to DirRootExternal on Marshmallow Devices

fredo

Well-Known Member
Licensed User
Longtime User
Could someone give me a hint how to solve this?

When I try
B4X:
File.Copy(File.DirAssets, FileName, File.DirRootExternal, FileName)
on Marshmallow (API 23) devices I get this error:
Even the Manifest entry
B4X:
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
has no effect.

I used the Visual Studio Emulator for this, since I have no real Marshmallow device on hand.

The interesting part is that the error does not appear on devices with API < 23.

So I think it could have something to do with the new security model for android but I can't get a grip on that.

Enclosed is a screenshot and a short project.
 

Attachments

  • MarshmallowDirExternal.png
    MarshmallowDirExternal.png
    129.9 KB · Views: 830
  • MarshmallowDirExternal.zip
    11.8 KB · Views: 405
  • aaafredotest.apk
    142.8 KB · Views: 309