Get ready to explore the folders of the device's persistent storage. Use the following steps:
Open the command-line tool and create a new project using the Cordova CLI tool you installed before. This will create a new directory called
FileSystem
in your current working directory:$ cordova create FileSystem
Move to the directory you just created:
$ cd FileSystem
Add the platforms you want to test on the device API. For this example, we add the Android platform:
$ cordova platform add android
Add the File API plugin using the following command:
$ cordova plugin add cordova-plugin-file
Go to the
www
folder, open theindex.html
file, and add adiv
element with theid
value asfileslist
inside the body of the app:<div id="fileslist"></div>
We will now add a
deviceready
event listener in the JavaScript section. TheonDeviceReady
function has to be called once thedeviceready
event is fired:document.addEventListener("deviceready", onDeviceReady, false...