New PhoneGap Forums
You’ve got questions? We’ve got answers! We’re super happy to announce our new PhoneGap Forums to help support all of your PhoneGap development endeavors. We’re committed to help and will be ensuring these forums are backed with enough resources from our team and the awesome Adobe Community Professionals that volunteer their time to help get your problems solved quickly and questions answered in a timely fashion. Check out yesterday’s official blog post with the specific links and details!
Template Support & PhoneGap CLI 6.0.0
PhoneGap CLI 6.0.0 was also announced this week with support for the latest version of Apache Cordova. One of the biggest features in the latest version of Cordova is support for templates and we want to make sure developers are aware of this new option and how to use it from both PhoneGap and Cordova.
Templates allow you to create a project based on another starter project other than the default Hello World to help you get started quickly. For instance, if you are a more advanced user that wants to start off with the most basic project shell enabled for Cordova/PhoneGap then you can just use the
blank template and start coding without having to delete a bunch of code first. Plus, we now have templates available to get you started quickly with a Framework7 or React project. All you need to do is specify a
--template flag with the
create command specifying a local path, an npm package name or a GitHub repo URL. The PhoneGap CLI also supports the use of a shortcut name for our own team maintained templates and includes an extra
template list command (
$ phonegap template list) you can use to find out the available shortcut names for the currently supported templates.
For example, using the shortcut for the
blank template with the PhoneGap CLI:
From the Cordova CLI you would specify the npm package name:
All PhoneGap team templates are available in npm prefixed with
phonegap-template-* and searched using keyword
Be sure to check out the official blog post regarding this update for more details. Additionally, we’re currently working on adding support for templates in the PhoneGap Desktop app as well so stayed tuned!
We believe developers should be able to start testing and debugging their PhoneGap apps as quickly as possible and the easiest way to do so is by leveraging existing well-known web developer tools; aka your favorite browser with the built-in dev tools we already use daily. To enable this more easily with PhoneGap, we’ve updated our middleware used when you run the
phonegap serve command via the CLI to turn on browser support by default. We’ve also ensured all the core PhoneGap plugins can run in the browser via a proxy without issue and fall back to any APIs the browser already supports. You will see which plugins are using a proxy (not supported directly by the browser) in the output of the
serve command, for instance:
[phonegap] [console.log] adding proxy for Device
[phonegap] [console.log] adding proxy for File
[phonegap] [console.log] adding proxy for Capture
[phonegap] [console.log] adding proxy for Camera
[phonegap] [console.log] adding proxy for Accelerometer
[phonegap] [console.log] adding proxy for Compass
[phonegap] [console.log] adding proxy for NetworkStatus
[phonegap] [console.log] adding proxy for Globalization
The workflow is simple to get started quickly.
Open your command line or terminal app and install the latest PhoneGap CLI
npm install -g phonegap
Create a project
phonegap create myApp
Serve it up
- Open your browser to the IP Address served and start debugging!
Mixed Native & Hybrid Project/Docs
We’ve seen a lot of interest in mixing native and web components by embedding Cordova webviews in a native project to allow you to get the best of both worlds. I recently created a prototype with CocoaPod specs for iOS to help make this much easier and documented it in the PhoneGap docs here. It essentially allows you to enable a native iOS project with Cordova and the core plugins easily using CocoaPods. This approach works with both Objective-C based projects and Swift-based projects and definitely helps lower the barrier to entry for developers who want to try it.
PhoneGap Desktop App
The PhoneGap Desktop App also underwent a recent update and fixes the
EADDRINUSE :::3000 issue as well as adding auto update for users running on OSX. There are more details regarding this update and links to the release notes here.