45
Chapter 3
Configuring PhoneGap
In Chapter 1, we learned the procedure to configure PhoneGap for the Android environment. In
this chapter, we will learn to explore the rest of the mobile platforms. at is, we will learn to con-
figure PhoneGap for mobile platforms like iOS, Windows Phone 7, BlackBerry, bada, and webOS.
e topics covered in this chapter include:
Configuring PhoneGap for iOS
Configuring PhoneGap for Windows Phone 7
Configuring PhoneGap for the BlackBerry
Configuring PhoneGap for bada
Configuring PhoneGap for webOS
Configuring PhoneGap for iOS
iOS is an operating system that was developed by Apple and is successfully applied to the iPhone,
iPod Touch, iPad, Apple TV, and other Apple products. A few of its features are given below:
Enables multitouch operationIncludes swiping, tapping, pinching, and reverse pinching.
Supports iCloudStores music, photos, apps, mail, contacts, and documents, and can
push to all devices wirelessly. at is, our content can be pushed on the Mac, iPhone, and
iPod Touch, too.
SecureiOS secures the data by encrypting it.
Supports developers—Apple provides a rich set of tools and application programming
interfaces (APIs) to create different varieties of sophisticated apps and games. It is because of
this that in addition to built-in apps, there are over 700,000 more apps and games available
in the App Store.
Hardware advantage—iOS enables developers to take full advantage of the iOS device
hardware, such as the retina display, multitouch interface, sensors, front and back cameras,
microphone, and so forth.
46 ◾  PhoneGap Build
Free updates—iOS updates are free. Whenever new updates are available, the device alerts
of the latest version and the upgraded version can be easily downloaded on the iPhone, iPad,
or iPod Touch wirelessly.
Supports different languagesiOS supports over 30 languages and has built-in diction-
ary support for over 50 languages, making it a popular mobile platform all over the world.
Supports voice recognitionEnables users to send messages, schedule meetings, and per-
form other tasks just by speaking.
To develop the PhoneGap application for iOS, we require the following things:
An Intel-based computer running Mac OS X Snow Leopard (10.6) or later.
Latest version of Xcode (version 4 or above). Xcode is a developer tool that is used for iOS
development. I used Xcode 4.4.1 in this book. I assume Xcode is already installed on our
machine.
Next, we need to install the Xcode Command Line Tools. So, select the Xcode
Preferences->Downloads->Components->Command Line Tools->Install
option (see Figure 3.1).
Download the latest version of PhoneGap from http://phonegap.com/. e latest
version of PhoneGap at the time of this writing is 2.3.0. On unzipping the downloaded
PhoneGap file, we find numerous subfolders, each labeled with the targeted OS inside the
lib folder. For configuring PhoneGap for iOS, we will need the /lib/iOS subfolder that
contains several files, as shown in Figure 3.2.
Note: We also need to register as an Apple developer in Apple’s developer program. It is an
essential requirement to deploy any iOS applications on the devices or through Apple’s App Store.
ere is a yearly membership fee for different development programs. For more information, visit:
http://d evelop e r.ap ple.co m .
We launch Ter m in al.app by dragging the bin subfolder from the iOS folder (which was
provided in the PhoneGap package) shown in Figure 3.2 and dropping it into the Ter minal.app
Figure 3.1 Installing Command Line Tools.

Get PhoneGap Build now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.