In 2011, Adobe purchased an existing mobile application development framework by Nitobi, branding it at that time with the name PhoneGap. They’ve since released it into the open source arena as “Apache Cordova” although many of us still refer to it as PhoneGap. If you’ve ever attempted to create native iOS, Android or Microsoft Phone applications then you’ll enjoy this new multi-platform approach.
Before PhoneGap, you’d have to install a development kit for each of the various platforms you wanted to target. And then, you’d need to learn the platform language of each major player: Objective-C or Swift for iOS, Java for Android and XAML with C# for the Microsoft Phone. Good luck trying to then design and maintain three completely-different collections of phone app code which hope to provide the same functionality.
I’ll add to this that jQuery Mobile does a great job of streamlining some of the work you can do with PhoneGap. It includes both methods for interacting with the browser’s DOM and a nice collection of CSS for displaying and lining up the widgets your app will need, for example, phone-styled push buttons that are sized correctly for fingers.
An initial set of app code is created from a command-line interface, producing a collection of files you’ll need for your app. You’ll usually focus on two files within this collection: config.xml and www/index.html. The first will configure the name, version and rights that your app will need and the second defines the interface. Use any editor you’re comfortable with. And if you’re familiar with the github source code management then this can be useful later when you build your app.
You usually develop with the help of the PhoneGap Desktop App plus a phone-specific version of the PhoneGap Developer App. The Desktop App reads your code and serves up a development version of your application; the specific Developer App for your phone will allow you to test your code. As you make changes in your code the Desktop App will send the new version to your phone so that you can instantly see the change.
Up to this point, none of this yet requires any build keys from Apple, Microsoft or in the case of an Android app, your own self-signed certificate. Since PhoneGap’s Developer App itself is signed, you’re good to go.
The default set of files from PhoneGap comes pre-equipped with the Jasmine test suite built in. Edit the www/spec/index.js file to modify the default tests, verify that the PhoneGap Desktop App is running and then execute them by bringing up the /spec folder for your application within the PhoneGap Developer App.
When you’re ready to start seeing your application as a stand-alone app you can then build it on the PhoneGap Build website.
You have two choices for pushing your code to PhoneGap Build: 1) compress your files into a ZIP file and upload it or 2) use a github.com repository for your project and tell Adobe that location.
Since phone apps need to be digitally-signed to identify the developer it’s then necessary to upload to PhoneGap Build one or more keys for this purpose. An iOS app will need an Apple Developer key, a Microsoft Phone app will need a Microsoft Developer key and finally, an Android app uses a self-signed certificate that you can create without Google’s knowledge/consent or paying them a fee (as is the case for the first two platforms). The PhoneGap Build website provides enough guidance in this area.
Once built, the PhoneGap Build website provides one or more individual binary downloads on a per-platform basis as well as a QR Code scan image that you can use to direct your phone to fetch the appropriate one.