Android Question EACCES(permission denied)


Licensed User
Using a supplied example but trying to load and play a song from the device (Android 6) and using B4A 9.9
I am unable to play the song and get the EACCES error as titled above???
What am I doing wrong - or more likely failing to do..

Public Sub Play

Service.StartForeground(nid, CreateNotification("Playing music - Radio Paradise"))

Dim MyFolder As String
MyFolder=File.DirRootExternal & "/Music"
pl.Prepare(pl.createfilesource(MyFolder, "Standingthere.mid"))

End Sub


Licensed User
Thanks for responding Erel, but I had already viewed that area and I'm still utterly confused. I've spent hours trying to achieve what seems like a simple objective - a background task that will access and play songs from the devices own memory.
I'm ready to give up and forget all about B4A.


Well-Known Member
Licensed User
don't use File.DirRootExternal. use File.DirInternal. store your stuff there. android doesn't want you to use File.DirRootExternal. it may be the device's "own memory", but it's not yours. you need permission to use it (and a number of other resources which belong to the device but not to you).