Android Question Problem File.WriteString - Permission denied

awama

Active Member
Licensed User
Longtime User
Hallo

this code run on Android 5.0 ,
writing Text-File on USB-Drive

now I have an new Handy with Android 8.0 and I habe this Problem with File.WriteString
I try with
SDK 19, 26, 28 and
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)

If File.Exists("/storage/USBstickName/Foldername","Settings.txt") Then 'this works
Settings=File.ReadString("/storage/USBstickName/Foldername","Settings.txt") 'this works

If Settings = 1 then
File.WriteString("/storage/USBstickName/Foldername","Settings.txt", "2") 'this doesn't work with error (Permission denied)
end if

Else

Settings=DefSetting
EndIf

What can I do?

Best thanks

awama
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

awama

Active Member
Licensed User
Longtime User
Thanks for fast reply,

but my Code works with Android 5.1 ...

I will try now with the externalstorage class
 
Upvote 0

awama

Active Member
Licensed User
Longtime User
Yes, I using TargetSDK 26, 27 , 28

must I select my file to copy to USB-Stick first manually in Listview (with ExternalStorage Class ) ?

Is it not possible programmable copy one file from intern to USB-Stick?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top