Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
PhoneGap 4 Mobile Application Development Cookbook
PhoneGap 4 Mobile Application Development Cookbook

PhoneGap 4 Mobile Application Development Cookbook: Build real-world hybrid mobile applications using the robust PhoneGap development platform

eBook
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

PhoneGap 4 Mobile Application Development Cookbook

Chapter 1. Welcome to PhoneGap 3

In this chapter, we will cover the following recipes:

  • Installing PhoneGap 3
  • Creating a new project
  • Using the command line
  • Installing API plugins

Introduction

This chapter explains the basic information about PhoneGap and how to get started with using PhoneGap. PhoneGap 3 is a big release in PhoneGap's history so far. In the older version, we had to download PhoneGap manually every time there was a new release. The pain is now over. With PhoneGap command-line interface (CLI), which was released along with PhoneGap 3, we are able to install PhoneGap directly from the command line.

PhoneGap 3 has improved the workflow for building cross-platform hybrid mobile applications. Thanks to NodeJS, creating a new project, adding a device platform, building an application, and running the application can now be performed from the command line. We don't need to open our project using each IDE, which can save us a lot of time.

Being a hybrid application means PhoneGap can give access to native functionality using web technology. We can add plugins to let our application get native capabilities. Adding plugins is easy with PhoneGap 3. Unlike older versions of PhoneGap, where we added plugins manually to each project, we can now use the CLI to add plugins to our project.

Installing PhoneGap 3

Installing PhoneGap is as easy as installing the node package manager (NPM) package. PhoneGap CLI uses NodeJS to power its command-line tool. NodeJS is a cross-platform runtime environment that uses the Google V8 JavaScript engine to execute code. NodeJS applications, including PhoneGap CLI, are written in JavaScript.

Getting ready

Before installing PhoneGap, you will need to ensure that you have all the required elements, as follows:

  • A PC or Mac running Windows, OS X, or Linux. Note that you can build and run an iOS application on OS X only.
  • A text editor, preferably with syntax highlighting, such as Notepad++ or Sublime Text.

How to do it…

As mentioned earlier, PhoneGap CLI is an NPM package, so we can easily install it using NPM. To install PhoneGap CLI, follow these steps:

  1. First, we need to download and install NodeJS from http://nodejs.org/ for our operating system. The installation process may be different for different operating systems. To check whether it's installed or not, you can open the terminal or Command Prompt (for Windows). Run node -v or npm -v. If you see the version number, as shown in the following screenshot, it means that you have NodeJS installed on your machine:
    How to do it…

    Checking the NodeJS and npm version

  2. Then download and install Git client from http://git-scm.com/ if you don't have one already. PhoneGap CLI uses Git behind the scenes to download some assets during project creation.
  3. Install the phonegap module using npm. The phonegap module will automatically be downloaded and installed by running the following commands:
    • On Linux and OS X:
      sudo npm install -g phonegap
      
    • On Windows:
      npm install -g phonegap
      
  4. Run the phonegap command on the terminal. You will see a help message, as follows:
    How to do it…

    Running the phonegap command to get a help message

How it works…

PhoneGap CLI is an NPM module, which is why we have to install NodeJS first. The NPM registry is located at https://www.npmjs.org/, and the PhoneGap CLI package is located at https://www.npmjs.org/package/phonegap.

The npm install command is a command used to install a new NPM module, and phonegap is the name of the module. The npm will search for a module named phonegap in the registry at https://www.npmjs.org/. Then, it will download the phonegap package along with its dependencies. We don't have to worry about which dependencies are used by phonegap; npm will do that for us. After the package has been downloaded successfully, npm will make the phonegap command available from the command line.

You might have noticed that we used a -g flag. This flag is used to install the module globally on our machine. It's necessary to make the phonegap module available globally so that we can run the phonegap command from anywhere, rather than only from a specific directory.

Note

NPM is like gem to Ruby and Composer to PHP if you have worked with Ruby or PHP before.

There's more…

It's valuable to know how NodeJS and NPM work because PhoneGap CLI is an NPM package. A public NPM package must be registered at https://www.npmjs.org/. Each NPM package is versioned using Git and must contain a package.json file in the repository. The PhoneGap CLI repository is located at https://github.com/phonegap/phonegap-cli.

The following JSON code is the package.json file from https://github.com/phonegap/phonegap-cli/blob/master/package.json:

{
    "name": "phonegap", // npm module name
    "description": "PhoneGap command-line interface and node.js library.", // module description
    "version": "3.5.0-0.21.18", // version number
    "homepage": "http://github.com/phonegap/phonegap-cli", // module homepage
    // repository type and url.
    "repository": {
        "type": "git",
        "url": "git://github.com/phonegap/phonegap-cli.git"
    },
    // module keywords
    "keywords": [
        "cli",
        "cordova",
        "phonegap",
        "phonegap build",
        "phonegap/build"
    ],
    // global installation is preferred
    "preferGlobal": "true",
    // main js file
    "main": "./lib/main.js",
    // binary code for the module.
    "bin": {
        "phonegap": "./bin/phonegap.js" // phonegap command will use ./bin/phonegap.js
    },
    // script is command for certain action. in this case running npm test will run jasmine-node --color spec
    "scripts": {
        "test": "jasmine-node --color spec"
    },
    "engineStrict": "true", // force to use specific node engine
    "engines": {
        "node": ">=0.10.0" // node engine is set to min of version 0.10.0
    },
    // module dependencies
    "dependencies": {
        "colors": "0.6.0-1",
        "cordova": "3.5.0-0.2.7",
        "cordova-lib": "0.21.7",
        "connect-phonegap": "0.13.0",
        "minimist": "0.1.0",
        "phonegap-build": "0.8.4",
        "pluralize": "0.0.4",
        "prompt": "0.2.11",
        "qrcode-terminal": "0.9.4",
        "semver": "1.1.0",
        "shelljs": "0.1.4"
    },
    // in-development module dependencies.
    "devDependencies": {
        "jasmine-node": "1.14.5",
        "chdir": "0.0.x"
    },
    // module contributors
    "contributors": [
        {
            "name": "Michael Brooks",
            "email": "michael@michaelbrooks.ca",
            "url": "http://michaelbrooks.ca/"
        },
        {
            "name": "Lorin Beer",
            "email": "lorin.beer@gmail.com",
            "url": "http://www.ensufire.com/"
        },
        {
            "name": "Jesse MacFadyen",
            "url": "http://risingj.com"
        },
        {
            "name": "Ryan Stewart",
            "email": "ryan@adobe.com"
        }
    ]
}

Tip

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

NPM will download and install every dependency referenced by package.json. You will notice the cordova module among the dependencies. NPM will download the cordova module too, so you can run cordova commands from your command line.

Note

If somehow the cordova module is not installed on your machine after installing PhoneGap CLI, you can install it manually by running npm i -g cordova from the terminal.

Apache Cordova (http://cordova.apache.org/) is the software underlying PhoneGap. Previously, PhoneGap and Cordova were one software project. But after Adobe acquired Nitobi, the original developer of PhoneGap, PhoneGap code was contributed to the Apache Software Foundation as Apache Cordova.

Creating a new project

Creating a new PhoneGap project is easy thanks to PhoneGap CLI. Unlike older versions of PhoneGap, where we needed to download the project template manually, we can create new projects directly from the command line. With just a single command, we can create a new project and start writing our application.

How to do it…

To create a new PhoneGap project, open your terminal or cmd. Then go to the directory where you want to maintain your source code. Run the following command:

phonegap create hello com.myapp.hello HelloWorld

It may take some time to complete the process, so be patient and let PhoneGap CLI do its magic. You will see some message during the project creation process:

How to do it…

Creating a new project progress

Congratulations! You have created your first PhoneGap project. Now, let's browse the project directory. You will see the directories as shown in the following screenshot:

How to do it…

The PhoneGap project structure

Most of the directories are empty; we will discuss the use of each directory later in the next recipe. The www/ directory is where you write code for your application. PhoneGap generated the initial starter app to work with.

How it works…

The phonegap create command is a command used to create a new project. The first argument, hello, specifies a directory for your project. Note that this directory must not exist initially; phonegap will create it for you.

The second argument, com.myapp.hello, is your application ID. The application ID is used as a unique identifier for an application. Two identical applications with different application IDs will be considered two different applications. The application ID is in reverse domain style. You can create something like com.yourdomain.applicationname.

The third argument, HelloWorld, is your application name. The application name will be used as the application's display title. This argument is optional. If you are not setting the application name, it will use the name from the first argument. If you want to change the name, you can open config.xml and edit the name element.

While we are running the phonegap create command, there are several things happening in the background:

  • The phonegap creates a new PhoneGap project with the given name and ID in the newly created directory. In our case, a PhoneGap project with the name as HelloWorld and ID as com.myapp.hello will be created under the hello directory.
  • The phonegap downloads the starter application and places it in www/ so that we can run the project directly after creating it.

    Tip

    You can use the -d option with any phonegap command to allow a verbose output. The -d option will give clear information about what is going on and the current status of the command.

Using the command line

After creating a new project, there are several things that need to be done before we are able to run the project. The workflow of PhoneGap consists of the following mandatory steps:

  1. Creating new project.
  2. Adding device platform.
  3. Building the project.
  4. Running the project.

How to do it…

The PhoneGap command consists of two environments. The first is the local command environment. The local commands execute the command on your local machine. In this case, you must have the target device SDKs configured on your machine. For example, if you want to develop an Android application, you must acquire and configure the Android SDK on your machine.

The second environment is remote. Command-line commands execute the build process remotely using the cloud-based PhoneGap Build service. In this case, you don't need to configure any SDK on your local machine.

The local commands

We created our first PhoneGap project in the previous recipe. The next thing to do is explore the phonegap commands. Follow these steps to learn about the phonegap commands that will be used to get your application running:

  1. Change the directory to your project directory. After creating a new project, simply run cd hello to go to your project's directory. All further phonegap commands need to be run in the project's directory.
  2. Before we can build and run our project, we have to add target platforms. The command used to add the platform is as follows:
    cordova platform add <target name>
    
  3. The <target name> argument is your target platform. The ability to build and run a project on your machine depends on the SDK availability for your machine. On Mac, you can run the following commands to add a specific platform:
    cordova platform add ios
    cordova platform add android
    cordova platform add amazon-fireos
    cordova platform add blackberry10
    cordova platform add firefoxos
    

    On Windows, you can add these platforms:

    cordova platform add wp7
    cordova platform add wp8
    cordova platform add wp7
    cordova platform add windows8
    cordova platform add amazon-fireos
    cordova platform add blackberry10
    cordova platform add firefoxos
    
  4. You may have noticed that we are using cordova instead of phonegap to add target platforms. I mentioned that cordova is one of the phonegap dependencies, so all cordova commands are available for the phonegap project.
  5. Let's add the Android platform for our project by running the cordova platform. Add android. Now browse through your project using the file explorer. You will see the android directory inside the platforms/ directory. The android directory is an Android project. You can open it on IDEs such as Eclipse or IntelliJ. The same thing happens when we add the iOS platform. We will get the ios directory inside platforms along with the Xcode project files:
    The local commands

    The native project inside the platforms/ directory

    Tip

    When PhoneGap and Cordova release a new version, we should update our platform-specific project by running phonegap platform update <platform>.

  6. The next step is to build the project. Building the project means compiling your application into byte code for the target device. Run the following command to build your project:
    phonegap build <platform>
    
  7. A PhoneGap application can run on the local development server. We can save time by testing our application on the local development server instead of running on an emulator or a real device. To run an application on the local web server, run the following command:
    phonegap serve
    
  8. The serve command has some options:
    --port, -p <n>       Port for web server. Default port is 3000
    --autoreload        Enable live-reload when file changes occur. Default is true
    --no-autoreload   Disable live-reload on file changes.
    --localtunnel        Enabling local tunnel, will expose the local server to the your network. Default value is false
    
  9. For example, to serve an application on port 1337 without auto-reload, you can run the following command:
    phonegap serve -p 1337 —no-autoreload
    
  10. Install the application platform by running this line:
    phonegap install <platform>
    
  11. The install command has some options:
    —device            Force installation to device
    —emulator        Force installation to emulator
    
  12. By default, phonegap will check whether you have a connected device or not. If a connected device is found, your application will be installed on that device. If no device is connected or found, phonegap will install it on the emulator. You don't need to open your emulator; phonegap will run it for you:
    The local commands

    A PhoneGap starter application installed on an iOS simulator

    Note

    To be able to run an application directly on your Android device, you have to enable USB debugging on that device.

  13. To run your application, you can use the following command:
       phonegap run <platform>
    
  14. The run command has some options:
    —device            Force application to run on device
    —emulator        Force application to run on emulator
    
  15. Just as with the install command, phonegap run will check whether you have a connected device or not, by default. If a connected device is found, your application will be run on that device. Otherwise, phonegap will run it on an emulator:
    The local commands

    A PhoneGap starter application running on an iOS simulator

Congratulations!!! You have created your first PhoneGap application and successfully launched it.

The remote commands

The PhoneGap CLI also ships a tool for integrating our application with PhoneGap Build. PhoneGap Build allows you to build your hybrid application without setting up any SDK on your local machine. Using PhoneGap Build, you can create an iOS application from Windows and create a Windows Mobile application from OS X.

To be able to use PhoneGap Build and the phonegap remote command, you have to sign up at http://build.phonegap.com. Make sure that you don't use the GitHub single sign-on. The phonegap remote doesn't support GitHub accounts. To use the phonegap remote commands, simply follow these instructions:

  1. Log in to your PhoneGap Build account. Simply open your command line and run this command:
    phonegap remote login
    
  2. You will be prompted to fill in your e-mail address and password. If you see the following message, it means that you have successfully logged in:
    [phonegap] logged in as <your email address>
    
  3. You don't need to add any platform to your project. To build your application, you have to run this command in your project directory:
    phonegap remote build <platform>
    
  4. The preceding command is similar to the phonegap build <platform> command. Instead of using an SDK on your local machine, the project build takes place on the PhoneGap Build server.
  5. You can run your application with the following command:
    phonegap remote run <platform>
    
  6. You will notice something different from our previous phonegap run <platform> command. The phonegap will not run your application directly, whether on your device or on an emulator. It will generate a QR code for you. You can scan the QR code with your phone, and it will download and install your application in your device.

    Note

    Almost all phonegap commands can be replaced with cordova commands; for example, phonegap build android can be replaced with cordova build android. But the phonegap remote command is available on phonegap only. So you can't do something like cordova remote build android.

    If you are confused between Cordova and PhoneGap, read about the history of Cordova and PhoneGap at http://phonegap.com/2012/03/19/phonegap-cordova-and-what's-in-a-name/.

How it works…

When building a PhoneGap application, the first thing to do is create a new PhoneGap project. PhoneGap will generate the project files automatically and give a starter application as a sample. Then we add platforms that we want to work with. For a remote-based build, we don't need to specify which platforms we want to work with. PhoneGap Build will prepare our application to work with iOS, Android, and Windows Mobile.

The main difference between local-based builds and remote-based builds is where the application building process is done. For local-based builds, PhoneGap will use the platform SDK that is installed on your machine to build the application. If the SDK is not found, PhoneGap will force you to use a remote-based build.

In the case of a remote-based build, your code will be uploaded to the PhoneGap Build server. Then the PhoneGap Build server will build your application using its machine. We do not get a device-specific project, such as an Android Eclipse project or iOS Xcode project, when using remote-based builds. What we get is a distribution-ready binary. We will get *.ipa for an iOS application and *.apk for an Android application.

Installing API plugins

A plugin is a piece of add-on code that provides an interface for native components. A plugin contains native code and a JavaScript interface. Using plugins, we can access native features using JavaScript code. We can get access to a camera, a file browser, geolocation, and so on by calling the PhoneGap JavaScript API.

How to do it…

The PhoneGap CLI allows us to manage plugins easily from the command line. Adding new plugins and removing existing plugins is easy now. We don't have to download and configure a plugin for each platform that we are targeting. Prior to PhoneGap 3, plugin management was a pain.

Adding plugins

When creating a new PhoneGap project, PhoneGap doesn't include any plugins in the project. It makes our initial application clean. First, we may want to build an application without native capabilities, just like developing a web application. Then we can add plugins to extend the application.

To add a plugin to an existing project, run the following command in your project directory:

phonegap plugin add <source>

The <source> argument can be the path to the plugin directory on a local machine, the git repository, or the plugin namespace. The following commands can be used to add a plugin from the various sources mentioned before:

phonegap plugin add /local/path/to/plugin/
phonegap plugin add http://example.com/path/to/plugin.git
phonegap plugin add org.apache.cordova.device

Once a plugin has been successfully added to a project, the plugin APIs can be executed using JavaScript. Each plugin has its own way of accessing native APIs, so read the documentation for each plugin.

Tip

You can search for an existing plugin using the cordova plugin search <keyword> command.

Listing plugins

After installing plugins, you can list all the installed plugins by running the following command:

phonegap plugin list

You will see a list of plugins installed, like this:

Listing plugins

Removing plugins

To remove the installed plugins, simply run the following command from your project directory:

phonegap plugin remove <id>

The <id> argument is the plugin id inside the plugin's plugin.xml file. The <id> argument is also the name of the plugin directory inside the plugins/ folder in your project. For example, if we want to remove the org.apache.cordova.device plugin, we can run this command:

phonegap plugin remove org.apache.cordova.device

How it works…

When the phonegap plugin add command is executed, phonegap will copy the plugin files from the source to the project under the plugins/ directory. Each plugin will have its own directory, with the plugin ID as the directory name. Inside each plugin folder, you will find the doc/, src/, tests/, and www/ directories, along with other files.

The doc/ folder contains the plugin documentation. The src/ folder contains native code for each platform. You will see Java code for Android, Objective-C code for iOS, and so on. The tests/ folder contains JavaScript unit tests for the JavaScript interface. The last folder is www/. It contains markup, styling, media, and JavaScript code that is used for presentation and to interface with native code. The main code of the PhoneGap application will be placed in the www folder.

After the plugin is copied to the plugins directory, phonegap will update or create a .json file inside plugins/. Each platform will have its own .json file. Android will have android.json, while iOS will have ios.json. These .json files hold the plugin configuration for each platform. The following is an example of the use of plugin configurations:

  • Adding a new permission: Some plugins may need to add permissions to be able to work properly. Here is an example of modifying AndroidManifest.xml for the Android project. A new ACCESS_NETWORK_STATE permission is added so that we can have access to the network state:
    "AndroidManifest.xml": {
        "parents": {
            "/*": [
                {
                    "xml": "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />",
                    "count": 1
                }
            ]
        }
    }
  • Modifying platform project files: Some plugins may need to add some configurations to each platform project. The following is an example of a configuration for modifying res/xml/config.xml in the Android project:
    "res/xml/config.xml": {
        "parents": {
            "/*": [
                {
                    "xml": "<feature name=\"NetworkStatus\"><param name=\"android-package\" value=\"org.apache.cordova.networkinformation
    .NetworkManager\" /></feature>",
                    "count": 1
                },
                {
                    "xml": "<feature name=\"Battery\">
                    <param name=\"android-package\" value=\"org.apache.cordova.batterystatus
                    .BatteryListener\" /></feature>",
                    "count": 1
                }
            ]
        }
    }
  • Declaring which plugins are used and plugin dependency: The configuration also holds information about which installed plugins are used for each platform:
    "installed_plugins": {
        "org.apache.cordova.network-information": {
            "PACKAGE_NAME": "com.myapp.hello"
        },
        "org.apache.cordova.battery-status": {
            "PACKAGE_NAME": "com.myapp.hello"
        }
    },
    "dependent_plugins": {}

See also

  • Chapter 2, Movement and Location – Using the Accelerometer and Geolocation Sensors
  • Chapter 3, Filesystems, Storage, and Local Databases
  • Chapter 4, Working with Audio, Images, and Video
  • Chapter 5, Working with Your Contacts List
  • Chapter 6, Hooking into Native Events
  • Chapter 11, Extending PhoneGap with Plugins
Left arrow icon Right arrow icon

Description

Developing mobile applications often feels intimidating. Especially when building cross-platform application. We have to learn a specific programming language to build an application for each platform. PhoneGap makes cross-platform mobile application development faster and easier by using web technologies such as HTML5, CSS, and JavaScript. This book gives you practical lessons on how to build a world class mobile application using PhoneGap. Whether you are a brand new to mobile application development, a web developer expert, or a seasoned mobile application developer, this book will guide you through creating hybrid mobile applications. Starting with setting up a development environment, the book moves on to utilizing a new PhoneGap command-line tool, installing plugins, and designing your application. It then moves on to concepts such as file system, storage, and local database, the book effectively lays a solid base for advanced topics. By working through the steps in each chapter, you will quickly master the features of PhoneGap. By the end of the book, you will be able to successfully build a highly functional, real-world hybrid mobile application using PhoneGap.

Who is this book for?

If you are a developer who wants to get started with mobile application development using PhoneGap, then this book is for you. Previous experience with data mining libraries will help, but is not mandatory. A basic understanding of web technologies such as HTML, CSS, and JavaScript is a must.

What you will learn

  • Set up a development environment to develop PhoneGap applications
  • Generate, build, and run applications using the PhoneGap commandline interface
  • Install plugins from the command line to add native capabilities to your application
  • Call the JavaScript API of plugins and hook into native events
  • Manipulate DOM using zepto and xuijs
  • Develop a user interface using jQuery Mobile and the Ionic framework
  • Get accustomed to using the PhoneGap Build service
Estimated delivery fee Deliver to Austria

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 30, 2015
Length: 356 pages
Edition : 1st
Language : English
ISBN-13 : 9781783287949
Category :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Austria

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Oct 30, 2015
Length: 356 pages
Edition : 1st
Language : English
ISBN-13 : 9781783287949
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 120.97
PhoneGap By Example
€36.99
PhoneGap 4 Mobile Application Development Cookbook
€41.99
Mastering PhoneGap Mobile Application Development
€41.99
Total 120.97 Stars icon

Table of Contents

13 Chapters
1. Welcome to PhoneGap 3 Chevron down icon Chevron up icon
2. Movement and Location – Using the Accelerometer and Geolocation Sensors Chevron down icon Chevron up icon
3. Filesystems, Storage, and Local Databases Chevron down icon Chevron up icon
4. Working with Audio, Images, and Video Chevron down icon Chevron up icon
5. Working with Your Contacts List Chevron down icon Chevron up icon
6. Hooking into Native Events Chevron down icon Chevron up icon
7. Working with XUI Chevron down icon Chevron up icon
8. Working with the Ionic Framework Chevron down icon Chevron up icon
9. Ionic Framework Development Chevron down icon Chevron up icon
10. User Interface Development Chevron down icon Chevron up icon
11. Extending PhoneGap with Plugins Chevron down icon Chevron up icon
12. Development Tools and Testing Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8
(4 Ratings)
5 star 25%
4 star 50%
3 star 0%
2 star 25%
1 star 0%
Somu Shekar Nov 24, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Provides in depth knowledge on building hybrid mobile application. Its very good book for start off mobile application. Also covers Ionic faramwork which is build on Angluafjs, SAAS, html5. Recommended who wants to build rich/responsive hybrid app for beginners and web developers migrated to mobile application develpment
Amazon Verified review Amazon
Drew Kinney Nov 20, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
If you are interested in the nuts and bolts of PhoneGap development, this is a good read.This book gives you insight into why you would want to learn this methodological approach, along with how the process works.I recommend this for any web designer/developer who wants to get into mobile development.
Amazon Verified review Amazon
Vinay Dec 22, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Nice book. Well done!!
Amazon Verified review Amazon
Marco Ronchi Aug 05, 2016
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Il libro mi sembra scritto in fretta, manca spesso di coerenza nei vari passaggi e analizza in maniera davvero troppo superficiale l'integrazione dei vari plugin, analisi che era il motivo per cui l'avevo comprato. Deluso.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela