Problems writing to USB flash drive

Walter

Member
Licensed User
Longtime User
In my application I want to captured data
Save by Button Click on a USB stick.
Tablet Android 4.2

And I get the following error:
open failed: AEACCES (Permission denied)

When reading files in the USB flash drive I have no problems!

Are there simple and really working example?
 

DonManfred

Expert
Licensed User
Longtime User
Do you have added the right permission to your manifest?
B4X:
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE) ' Allows an application to write to external storage.
I dont know from which android version the access to external storage is limited by google... Maybe 4+

In this case you should use
B4X:
File.DirDefaultExternal
 

Walter

Member
Licensed User
Longtime User
Thanks for the information
Error has remained

File.Copy (File.DirRootExternal, "INI.txt", "/ mnt/usbhost1", "INI.txt")
 

sorex

Expert
Licensed User
Longtime User
that space between / & mnt is that copy/paste thingy?
 

Walter

Member
Licensed User
Longtime User
only at our Info
the App it is natural
File.Copy (File.DirRootExternal, "INI.txt", "/mnt/usbhost1", "INI.txt")

Same mistake!
 

Walter

Member
Licensed User
Longtime User
at 4.3 it works
4.2.2 when it does not work
both devices are not rooted

available at 4.2.2 Additional settings?
root manger says setting = r / w
 
Top