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

Listing all available contacts

Developers can access, read from, and filter the contacts saved within the device contact database, allowing us to query and work with the address book on the device.

How to do it...

We will create an application to read all of the contacts from the device database and output them as a dynamic list.

  1. Create a new HTML layout for this application. We will be using the jQuery Mobile framework in this example, and so we need to include the required JavaScript and CSS references within the head tag of our document.
  2. We'll also need to include the Cordova JavaScript file to interact with the native features on the device.
    <!DOCTYPE HTML> <html> <head> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, ...

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