You are previewing Mastering PhoneGap Mobile Application Development.
O'Reilly logo
Mastering PhoneGap Mobile Application Development

Book Description

Take your PhoneGap experience to the next level and create engaging real-world applications

About This Book

  • Create a useful PhoneGap workflow for larger projects in order to simplify and manage the development process

  • Use third-party plugins, IndexedDB, and SQLite for PhoneGap to develop large-scale, data-driven, and highly accessible applications

  • A pragmatic guide to construct top-notch large-scale applications using PhoneGap

  • Who This Book Is For

    If you have created simple applications using PhoneGap in the past and now want to take your workflow and apps to the next level, this book will help you reach your goals. You should have a good working knowledge of HTML, CSS, and JavaScript, and prior experience with PhoneGap.

    What You Will Learn

  • Construct build workflows that simplify complex application development

  • Integrate the next version of JavaScript to simplify your code

  • Create accessible hybrid applications

  • Persist and query data using third-party database plugins

  • Create your own PhoneGap plugins for your unique use cases

  • Create icons and splash screens suitable for submission to app stores

  • Publish your app to the Google Play and Apple iTunes stores

  • In Detail

    PhoneGap is a useful and flexible tool that enables you to create complex hybrid applications for mobile platforms. In addition to the core technology, there is a large and vibrant community that creates third-party plugins that can take your app to the next level.

    This book will guide you through the process of creating a complex data-driven hybrid mobile application using PhoneGap, web technologies, and third-party plugins.

    A good foundation is critical, so you will learn how to create a useful workflow to make development easier. From there, the next version of JavaScript (ES6) and the CSS pre-processor SASS are introduced as a way to simplify creating the look of the mobile application. Responsive design techniques are also covered, including the flexbox layout module. As many apps are data-driven, you'll build an application throughout the course of the book that relies upon IndexedDB and SQLite. You'll also download additional content and address how to handle in-app purchases. Furthermore, you’ll build your own customized plugins for your particular use case. When the app is complete, the book will guide you through the steps necessary to submit your app to the Google Play and Apple iTunes stores.

    Style and approach

    This book is a step-by-step guide, in which the concepts covered are explained with the help of hands-on examples

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the code file.

    Table of Contents

    1. Mastering PhoneGap Mobile Application Development
      1. Table of Contents
      2. Mastering PhoneGap Mobile Application Development
      3. Credits
      4. About the Author
      5. About the Reviewers
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Task Automation
        1. Before we begin
        2. About Logology
        3. Why use Gulp for task automation?
        4. Setting up your app's directory structure
        5. Installing Gulp
        6. Creating your first Gulp configuration file
        7. Creating a modular Gulp configuration
        8. Copying assets
        9. Performing substitutions
        10. How to execute Cordova tasks
        11. Managing version numbers
        12. Supporting ES2015
        13. Linting your code
        14. Uglifying your code
        15. Putting it all together
        16. Summary
      9. 2. ECMAScript 2015 and Browserify
        1. Getting started
        2. Benefits of ES2015
          1. Block scope
          2. Arrow functions
          3. Simpler object definitions
          4. Default arguments
          5. Variable arguments
          6. Destructuring and named parameters
          7. String interpolation
          8. Promises and a taste of ES2016
          9. Classes
          10. Modules
          11. More information
        3. Using Browserify
          1. Modifying our Gulp configuration
          2. Including Node.js packages
        4. Summary
      10. 3. Sassy CSS
        1. Getting started
        2. Learning Sass
          2. Calculation
          3. Variables
          4. Nesting
          5. Mixins and functions
          6. Object-oriented CSS
          7. Modules and partials
        3. Integrating Sass with Gulp
          1. Including the Stylesheets installed via npm
        4. Summary
      11. 4. More Responsive Design
        1. Getting started
        2. Pixel densities
        3. The CSS3 units
        4. Media queries
        5. Image sizing
        6. Using flex-box layout
        7. Summary
      12. 5. Hybrid Application Accessibility
        1. Getting started
        2. Types of accessibility features
          1. Color vision deficient
          2. Low vision
          3. Blindness
          4. Auditory disabilities
          5. Motor disabilities
          6. Dyslexia
          7. Seizures
        3. Accessibility for free
        4. What is WAI-ARIA?
          1. The WAI-ARIA roles
        5. Accessibility examples
          1. Separation of presentation and content
          2. Accessible icon buttons
          3. Accessible navigation
          4. Accessible lists
          5. Accessible alerts and dialogs
        6. Fitting in with native accessibility features
          1. Installing the Mobile Accessibility Plugin
          2. Detecting the user's preferred text size
          3. Detecting a screen reader
          4. Speaking custom text
        7. Useful tools
        8. Summary
      13. 6. Testing and UI Automation
        1. Getting started
        2. An introduction to assertions
        3. Writing tests using Chai
          1. Language chains
          2. Logical words
          3. Testing existence and types
          4. Testing equality
          5. Testing collections
        4. Running test suites using Mocha
        5. Writing UI automation tests
          1. Installing Appium
          2. Exploring your app with Appium
          3. Creating test cases
        6. Running UI Automation tests using Appium and Mocha
        7. Integrating our tests with Gulp
        8. Summary
      14. 7. IndexedDB
        1. Getting started
        2. IndexedDB support and polyfills
        3. Differences between relational and key-object storage
        4. Creating a database
        5. Creating an object store within the database
        6. Handling database upgrades
        7. Transactions
        8. Storing objects
        9. Getting objects
        10. Deleting objects
        11. Using cursors and indexes
        12. Closing the database
        13. Additional resources
        14. Summary
      15. 8. Web SQL Database
        1. Getting started
        2. Web SQL Database support
        3. The Cordova SQLite plugin
        4. Creating and opening databases
        5. Transactions
        6. Creating tables
        7. Inserting data and binding values
        8. Querying data (single table, joins, and so on)
        9. Deleting data
        10. The SQLite utilities
        11. Summary
      16. 9. Transferring Files
        1. Getting started
        2. Configuring the whitelist
        3. Downloading files from a server
        4. Receiving files using PHP on a server
        5. Uploading files to a server
        6. Monitoring progress
        7. Aborting transfers
        8. Security concerns
        9. Summary
      17. 10. Performance
        1. Getting started
        2. Defining performance
        3. The performance difference between desktop browsers, emulators, and physical devices
          1. Desktop browser performance differences
            1. Power availability and consumption
            2. Battery life
            3. Browser impacts
            4. Memory
            5. Storage
            6. Lag
          2. Emulator performance differences
        4. Profiling your app
          1. Profiling on Android
          2. Profiling on iOS
          3. Caveats
        5. Correcting input lag
        6. Correcting visual stutters
          1. Reaching 60 fps
        7. Correcting memory problems
        8. Splitting up and delegating long computations
        9. Summary
      18. 11. Graphical Assets
        1. Getting started
        2. App icon requirements
        3. Creating an app icon
        4. Launch screen requirements
        5. Creating a Launch Screen
        6. Configuring your app
        7. Useful resources
        8. Summary
      19. 12. Deployment
        1. Build modes
          1. Distribution methods
        2. Signing up for developer accounts
          1. Becoming an Apple iOS developer
          2. Becoming a Google Play Store developer
        3. Generating signed release builds
          1. Managing the iOS signing identities
          2. Managing iOS App IDs
          3. Managing iOS devices
          4. Managing the iOS provisioning profiles
          5. Creating an Android keystore
          6. Signing the release build
        4. Deploying ad hoc releases
          1. Deploying via e-mail
          2. Deploying via URL
          3. Deploying via Diawi
        5. Deploying app store releases
          1. Deploying to the Apple App Store
          2. Deploying to the Google Play Store
        6. Resources
        7. Summary
      20. Index