Mastering PhoneGap Mobile Application Development
eBook - ePub

Mastering PhoneGap Mobile Application Development

  1. 392 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering PhoneGap Mobile Application Development

About this book

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

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Mastering PhoneGap Mobile Application Development


Table of Contents

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

Mastering PhoneGap Mobile Application Development

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: February 2016
Production reference: 1190216
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-843-4
www.packtpub.com

Credits

Author
Kerri Shotts
Reviewers
Michael Brooks
Rory Standley
Eddy Verbruggen
Commissioning Editor
Akram Hussain
Acquisition Editors
Reshma Raman
Owen Roberts
Content Development Editor
Dharmesh Parmar
Technical Editors
Chinmay S. Puranik
Jayesh Sonawane
Copy Editor
Akshata Lobo
Project Coordinator
Nidhi Joshi
Proofreader
Safis Editing
Indexer
Tejal Daruwale Soni
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta

About the Author

Kerri Shotts has worked with computers for nearly 25 years. Her love for technology and programming started when she was introduced to her first computer: a Commodore 64. She obtained a degree in computer science while at college, and moved on to become a software test engineer. Afterward, she became an Oracle Database Administrator for several years. Now, she works as a technology consultant, creating, i...

Table of contents

  1. Mastering PhoneGap Mobile Application Development

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Mastering PhoneGap Mobile Application Development by Kerri Shotts in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.