O'Reilly logo

PhoneGap Mobile Application Development Cookbook by Matt Gifford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying the contents of a directory

As devices may offer us a lot of storage space that we can potentially use, we can also make sure we have the ability to traverse the filesystem to ascertain the structure of the storage available.

How to do it...

In this recipe we will build an application that will read the contents of a directory from the device's root filesystem and display them in a list format. The following steps will help you to do the same:

  1. Create the initial HTML layout for our application. For this recipe we will also be using the jQuery Mobile framework, so let's include the required JavaScript and CSS references, as well as the reference to the cordova-2.0.0.js file:
    <!DOCTYPE html> <html> <head> <title>Directory Reader</title> <meta ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required