PhoneGap Essentials: Building Cross-Platform Mobile Apps

Book description

PhoneGap is Adobe’s distribution of the free and open source framework (originally developed by Nitobi) that is now also available from the Apache Foundation as Apache Cordova™. Using PhoneGap, developers can build native mobile apps using standard HTML5, JavaScript, and CSS, and then deploy those apps to every leading mobile platform with little or no recoding. Up to now, though, PhoneGap was lacking complete, practical documentation. PhoneGap Essentials fills that void: It’s the first concise, yet complete, tutorial for succeeding with PhoneGap in real-world development.

Experienced mobile developer John M. Wargo thoroughly introduces the PhoneGap platform, explaining what it is, what it does, and how it works. He then guides you through configuring PhoneGap environments—creating complete mobile apps—and building them for the Google Android™, Samsung bada, BlackBerry® devices, Apple® iOS, Symbian™ OS, and Windows® Phone. Through realistic examples, you’ll master key PhoneGap APIs for everything from GPS to the file system, contacts to camera, device to events, and more. Wargo also demonstrates how to take full advantage of PhoneGap Build, PhoneGap’s cloud-based packaging utility.

Coverage includes

  • The anatomy of a PhoneGap application (what makes an application a PhoneGap application)

  • Understanding the impact of cross-platform development issues

  • Exploring the entire PhoneGap development process, including testing and debugging

  • Expanding PhoneGap’s capabilities with third-party development tools and plug-ins

  • Building cross-platform apps that use the device camera, compass, accelerometer, and other hardware

  • Reading from and writing to the contacts database and the device file system

  • Installing tools needed to develop PhoneGap apps for Android, bada, BlackBerry, iOS, Symbian, and Windows Phone

  • Reacting to events and notifying users

  • Using the Media API to record and play media files

  • Building for multiple platforms simultaneously using PhoneGap Build 

  • About the Website

    Downloadable code projects, additional information, and errata are available at

    Table of contents

    1. Title Page
    2. Copyright Page
    3. Dedication
    4. Contents
    5. Foreword: By Bryce A. Curtis
    6. Foreword: By Jim Huempfner
    7. Preface
      1. Inside the Book
      2. The Challenges in Writing a PhoneGap Book
      3. Code Conventions
      4. Web Resources
    8. Acknowledgments
    9. About the Author
    10. Part I. PhoneGap
      1. 1. Introduction to PhoneGap
        1. A Little PhoneGap History
        2. Why Use PhoneGap?
        3. How PhoneGap Works
        4. Designing for the Container
        5. Writing PhoneGap Applications
        6. Building PhoneGap Applications
        7. PhoneGap Limitations
        8. PhoneGap Plug-Ins
        9. Getting Support for PhoneGap
        10. PhoneGap Resources
        11. Hybrid Application Frameworks
      2. 2. PhoneGap Development, Testing, and Debugging
        1. Hello, World!
        2. PhoneGap Initialization
        3. Leveraging PhoneGap APIs
        4. Enhancing the User Interface of a PhoneGap Application
        5. Testing and Debugging PhoneGap Applications
        6. Dealing with Cross-Platform Development Issues
        7. API Consistency
    11. Part II. PhoneGap Developer Tools
      1. 3. Configuring an Android Development Environment for PhoneGap
        1. Installing the Android SDK
        2. Eclipse Development Environment Configuration
        3. Creating an Android PhoneGap Project
        4. Testing Android PhoneGap Applications
      2. 4. Configuring a bada Development Environment for PhoneGap
        1. Downloading and Installing the Correct PhoneGap bada Files
        2. Creating a bada PhoneGap Project
        3. Creating a bada Application Profile
        4. Testing bada PhoneGap Applications
      3. 5. Configuring a BlackBerry Development Environment for PhoneGap
        1. Installing the BlackBerry WebWorks SDK
        2. Creating a BlackBerry PhoneGap Project
        3. Building BlackBerry PhoneGap Applications
        4. Testing BlackBerry PhoneGap Applications
      4. 6. Configuring an iOS Development Environment for PhoneGap
        1. Registering as an Apple Developer
        2. Installing Xcode
        3. Creating an iOS PhoneGap Project
        4. Testing iOS PhoneGap Applications
      5. 7. Configuring a Symbian Development Environment for PhoneGap
        1. Installing the Nokia Web Tools
        2. Installing the Make Utility
        3. Creating a Symbian PhoneGap Project
        4. Configuring Application Settings
        5. Modifying HelloWorld3 for Symbian
        6. Packaging Symbian PhoneGap Projects
        7. Testing Symbian PhoneGap Applications
      6. 8. Configuring a Windows Phone Development Environment for PhoneGap
        1. Installing the Windows Phone Development Tools
        2. Creating a Windows Phone PhoneGap Project
        3. Testing Windows Phone PhoneGap Applications
      7. 9. Using PhoneGap Build
        1. The Fit
        2. Getting Started
        3. Configuration
        4. Creating an Application for PhoneGap Build
        5. Creating a PhoneGap Build Project
        6. Dealing with Build Issues
        7. Testing Applications
        8. Debug Mode
    12. Part III. PhoneGap APIs
      1. 10. Accelerometer
        1. Querying Device Orientation
        2. Watching a Device’s Orientation
      2. 11. Camera
        1. Accessing a Picture
        2. Configuring Camera Options
        3. Dealing with Camera Problems
      3. 12. Capture
        1. Using the Capture API
        2. Configuring Capture Options
        3. Capture at Work
      4. 13. Compass
        1. Getting Device Heading
        2. Watching Device Heading
      5. 14. Connection
      6. 15. Contacts
        1. Creating a Contact
        2. Searching for Contacts
        3. Cloning Contacts
        4. Removing Contacts
      7. 16. Device
      8. 17. Events
        1. Creating an Event Listener
        2. deviceready Event
        3. Application Status Events
        4. Network Status Events
        5. Button Events
      9. 18. File
        1. Available Storage Types
        2. Accessing the Device’s File System
        3. Reading Directory Entries
        4. Accessing FileEntry and DirectoryEntry Properties
        5. Writing Files
        6. Reading Files
        7. Deleting Files or Directories
        8. Copying Files or Directories
        9. Moving Files or Directories
        10. Uploading Files to a Server
      10. 19. Geolocation
        1. Getting a Device’s Current Location
        2. Watching a Device’s Location
      11. 20. Media
        1. The Media Object
        2. Playing Audio Files
        3. Recording Audio Files
        4. Seeing Media in Action
      12. 21. Notification
        1. Visual Alerts (Alert and Confirm)
        2. Beep
        3. Vibrate
        4. Notification in Action
      13. 22. Storage
        1. Local Storage
        2. SQL Database
    13. A. Installing the PhoneGap Files
      1. Preparing for Samsung bada Development
      2. Preparing for iOS Development
      3. Preparing for Windows Phone Development
    14. B. Installing the Oracle Java Developer Kit
      1. Downloading the JDK
      2. Installing the JDK
      3. Configuring the Windows Path
      4. Confirming Installation Success
    15. C. Installing Apache Ant
      1. Macintosh Installation
      2. Windows Installation
    16. Index

    Product information

    • Title: PhoneGap Essentials: Building Cross-Platform Mobile Apps
    • Author(s): John M. Wargo
    • Release date: June 2012
    • Publisher(s): Addison-Wesley Professional
    • ISBN: 9780132928373