Tested the following code in Windows and it works.
It does the desired task of copying "myalarm.wav" from the /media folder of the app to the "C:\Alarms" folder.
I can't for the life of me figure out how to get it to work saving to the /Alarms folder on an Android device.
NOTE: I am not talking about /system/media/audio/alarms but the non-system "/Alarms" folder you can access through most file explorers and a USB transfer connection.
I have tried the below code the following ways:
- AppGameKit player with "raw:/Alarms/myalarm.wav"
- manually installed APK with "raw:/Alarms/myalarm.wav"
- AppGameKit player with "/Alarms/myalarm.wav"
- manually installed APK with "/Alarms/myalarm.wav"
Screenshot of error message in all cases is attached.
Both AppGameKit Player and the manual install were given storage write permissions. I know AGk writes stuff to really strange places at times (ex: users/username/appdata/srslybro?/whyhideithere?) so I am at a bit of a loss as to how to even begin troubleshooting writing to external directories on Android.
AddVirtualButton(11,444,222,100)
SetVirtualButtonText(11, "copy file")
CreateMemblockFromFile( 1, "myalarm.wav" )
do
Print( ScreenFPS() )
Sync()
If GetVirtualButtonPressed(11)
CreateFileFromMemblock("raw:c:/Alarms/myalarm.wav",1)
EndIf
loop