In Chapter 1, we learned the procedure to conﬁgure 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-
ﬁgure PhoneGap for mobile platforms like iOS, Windows Phone 7, BlackBerry, bada, and webOS.
e topics covered in this chapter include:
◾ Conﬁguring PhoneGap for iOS
◾ Conﬁguring PhoneGap for Windows Phone 7
◾ Conﬁguring PhoneGap for the BlackBerry
◾ Conﬁguring PhoneGap for bada
◾ Conﬁguring PhoneGap for webOS
Conﬁguring 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 operation—Includes swiping, tapping, pinching, and reverse pinching.
◾ Supports iCloud—Stores 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.
◾ Secure—iOS secures the data by encrypting it.
◾ Supports developers—Apple provides a rich set of tools and application programming
interfaces (APIs) to create diﬀerent 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 diﬀerent languages—iOS 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 recognition—Enables 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
◾ 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 ﬁle, we ﬁnd numerous subfolders, each labeled with the targeted OS inside the
lib folder. For conﬁguring PhoneGap for iOS, we will need the /lib/iOS subfolder that
contains several ﬁles, 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 diﬀerent 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.