Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PhoneGap Beginners Guide (third edition)
  • Table Of Contents Toc
PhoneGap Beginners Guide (third edition)

PhoneGap Beginners Guide (third edition)

By : Ramanujam, Giorgio Natili
3.7 (6)
close
close
PhoneGap Beginners Guide (third edition)

PhoneGap Beginners Guide (third edition)

3.7 (6)
By: Ramanujam, Giorgio Natili

Overview of this book

This book is for web developers who want to be productive in the mobile market quickly. In fact, by using PhoneGap, it's possible to deploy native applications based on web standards. This book assumes a very small knowledge of HTML/CSS/JavaScript and mobile platforms, such as Android, BlackBerry, iOS, and Windows Phone, and takes the reader step-by-step into a deep overview of PhoneGap and its APIs.
Table of Contents (16 chapters)
close
close
13
C. Related Plugin Resources
15
Index

Installing dependencies

In order to be ready to build a PhoneGap app, it's mandatory to download and install the latest SDKs for each target platform of the app from the respective official websites:

Each of the preceding platform SDKs have their own setup configuration and it's advised to refer to the respective websites for updated information. To use several IDEs, such as NetBeans, Eclipse, or JBoss Developer Studio, we need Java to be available.

Java JDK

You need to install the most recent Java JDK (not just the JRE). Next, create an environment variable for JAVA_HOME, pointing to the root folder where the Java JDK was installed. For example, if your installation path is C:\Program Files\Java\jdk7, set JAVA_HOME to be this path. After that, add the JDK's bin directory (C:\Program Files\Java\jdk7\bin) to the PATH variable as well.

Apache Ant

We need Apache Ant to be installed and configured. Update your PATH to include the bin folder in the installation folder. For advanced configuration details, visit http://ant.apache.org/manual/index.html.

Due to the latest changes in the PhoneGap framework, it's always suggested to use the command-line interface to create a new project, update the framework, or install plugins. To work with the command line, we will need the Node.js application. To start with, download and install Node.js from http://nodejs.org. Once you have done this, you should be able to verify the installation by invoking npm or node on your command line. You may need to add the npm directory to your system PATH in order to invoke globally-installed npm modules.

At the end of every installation, you should be able to verify the installations of each package with the following commands:

android list sdk
javac –version
ant –version
node -v

If any of the preceding command lines don't work as required, you might need to revisit your system PATH settings. For example, PhoneGap and Cordova require the ANDROID_HOME environment variable to be set in PATH. This should point to the [ANDROID_SDK_DIR]\android-sdk directory (for example, c:\android\android-sdk).

Next, update your PATH to include the tools/ and platform-tools/ folders. So, using ANDROID_HOME, you would add both %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools.

For OS X users, it is also important to install ios-sim. The ios-sim tool is a command-line utility that launches an iOS app on the simulator. To install the tool, you can again use npm, as shown here:

npm install –g ios-sim

Depending on your privileges, you may have to run the npm command as an administrator (that is, adding sudo before the npm command).

Once the SDKs are installed, it's recommended that you also install the client for GitHub. GitHub is a social coding platform where you can find most of the cool open source projects (such as Apache Cordova), including access to the latest patches, builds, and sources. You can easily build your project for multiple platforms using PhoneGap's free online build service from a public GitHub repository.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PhoneGap Beginners Guide (third edition)
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon