How could I access to the files from the project files folder?

Hi! I am a bit new in Corona. I have been looking for an answer to my doubt but i did not find anything.

This is muy question: i want to create an application similar to a music player. The trouble comes when i want to access to the songs i`ve got in my “project files” folder. I do not know how to get them in order to be able to play the songs. 

I have found a similar function:  system.pathForFile( “”, system.ResourceDirectory ). Using this, i can access to the files of the project sandbox folder. However, I do not like this  function as i would also like to access to the songs that the users have in their smartphone, not only inside the application files.

So, how could I access to the files of the smartphone and the files inside the “project files” folder?

I would appreciate any help,

Thank you,

J.

Hi Jesus.  There are a couple of things in play here.  First, if you plan to use the audio.* API’s, you don’t need system.pathForFile, simply:

audio.loadStream( "mysong.mp3 , system.ResourcesDirectory )

By Apple and Android rules, apps can only access files in their sandbox (system.ResourcesDirectory, system.DocumentsDirectory, system.TemporaryDirectory and system.CachesDirectory).  To access anything else, you have to use an Operating system provided interface.

We currently offer an iTunes plugin that lets your app get to the iTunes library for iOS.  We don’t have something similar for Android yet.   However, you have to be a Pro subscriber to access this premium plugin.

Rob

Hi Jesus.  There are a couple of things in play here.  First, if you plan to use the audio.* API’s, you don’t need system.pathForFile, simply:

audio.loadStream( "mysong.mp3 , system.ResourcesDirectory )

By Apple and Android rules, apps can only access files in their sandbox (system.ResourcesDirectory, system.DocumentsDirectory, system.TemporaryDirectory and system.CachesDirectory).  To access anything else, you have to use an Operating system provided interface.

We currently offer an iTunes plugin that lets your app get to the iTunes library for iOS.  We don’t have something similar for Android yet.   However, you have to be a Pro subscriber to access this premium plugin.

Rob