Friday, June 19, 2015

Including Plugins with Cordova Command Line Interface 5

You may have noticed that things have changed up a bit as of Cordova CLI 5.0.0 release. Specifically, we are now encouraging the the use of <plugin> tags in your config.xml file over the previously used <feature> tags.

You may be wondering why you should use the <plugin> tag. The main reason is that when you use the <plugin> tag it will fetch and install the plugin for you during the cordova prepare phase of building your project.

So if you have the following feature tags in your current config.xml:
<feature name="org.apache.cordova.file">
    <param name="id" value="org.apache.cordova.file@1.0.1"/>
</feature>
<feature name="org.apache.cordova.file-transfer">
    <param name="id" value="org.apache.cordova.file-transfer@0.4.2"/>
</feature>
<feature name="org.apache.cordova.device">
    <param name="id" value="org.apache.cordova.device@0.2.8"/>
</feature>
<feature name="com.telerik.plugins.nativepagetransitions">
    <param name="id" value="https://github.com/Telerik-Verified-Plugins/NativePageTransitions#0.2.11"/>
</feature>
<feature name="com.phonegap.plugins.pushplugin">
    <param name="id" value="https://github.com/phonegap-build/PushPlugin#1979d972b6ab37e28cf2077bc7ebfe706cc4dacd"/>
</feature>
Then you'd just replace it with:
<plugin name="cordova-plugin-file" spec="^2.0.0" />
<plugin name="cordova-plugin-file-transfer" spec="^1.0.0" />
<plugin name="cordova-plugin-device" spec="^1.0.0" />
<plugin name="com.telerik.plugins.nativepagetransitions" spec="https://github.com/Telerik-Verified-Plugins/NativePageTransitions#0.2.11" />
<plugin name="com.phonegap.plugins.pushplugin" spec="https://github.com/phonegap-build/PushPlugin#1979d972b6ab37e28cf2077bc7ebfe706cc4dacd" />
You may have noticed that the package ID for org.apache.cordova.file has changed to cordova-plugin-file. The is part of the way plugins are now hosted on npm. You'll notice that all the core plugins (org.apache.cordova) have been renamed (see table below).

For non-core plugins you can still download them from a git repository. In order to specify a specific version you use #versionNumber for example, NativePageTransistion above or to download from a specific commit use #commitHash for example, PushPlugin above.

Old ID NPM ID
org.apache.cordova.battery-status cordova-plugin-battery-status
org.apache.cordova.camera cordova-plugin-camera
org.apache.cordova.contacts cordova-plugin-contacts
org.apache.cordova.device cordova-plugin-device
org.apache.cordova.device-motion cordova-plugin-device-motion
org.apache.cordova.device-orientation cordova-plugin-device-orientation
org.apache.cordova.dialogs cordova-plugin-dialogs
org.apache.cordova.file cordova-plugin-file
org.apache.cordova.file-transfer cordova-plugin-file-transfer
org.apache.cordova.geolocation cordova-plugin-geolocation
org.apache.cordova.globalization cordova-plugin-globalization
org.apache.cordova.inappbrowser cordova-plugin-inappbrowser
org.apache.cordova.media-capture cordova-plugin-media-capture
org.apache.cordova.media cordova-plugin-media
org.apache.cordova.network-information cordova-plugin-network-information
org.apache.cordova.splashscreen cordova-plugin-splashscreen
org.apache.cordova.statusbar cordova-plugin-statusbar
org.apache.cordova.whitelist cordova-plugin-whitelist
org.apache.cordova.vibration cordova-plugin-vibration

Saturday, June 13, 2015

Mud Hero 2015

So last Saturday Anna and I participated in the Mud Hero Ottawa run. It was an absolute blast as you can probably tell by looking at the smiles on our faces. We took a bunch of pictures during the day which I have in an album over here.
First up Anna ran the kids course which was three 500 meter laps with 6 obstacles. The announcer constantly mentioned to parents to make sure that the kids schools were on tight or else they would lose them in the mud pit. Predictably, this led to a bunch of parents having to dig in the mud pit for their child's missing shoe.

Anna escaped with both of her shoes but as you can see she got super muddy which I encouraged whole heartedly.
Then I finally had my chance to run the 6km course with 20 obstacles with my buddy Hicham and one of his neighbours. There were some really fun obstacles like walls, tires, ropes, slides but by far the most fun was the waist deep (or deeper) mud. You can see in this pic I've just come down the slide and luckily retrieved my hat from the mud puddle.

After the race the team from Muscle Mlk was there to hand out ready to drink protein shakes. I don't know if it was because I just ran 6km but that was the best vanilla shake I've had in a long time.

For anyone who is interested in these types of races I can offer a few tips:

  1. Bring a complete change of clothes including shoes. You will not want to put your muddy shoes on after getting clean.
  2. Wear non-cotton underwear. You really need something that isn't going to trap in a pound of dirt in your skivvies. 
  3. Bring a big fluffy towel to get warm. The "showers" are generally hoses of cold water so you will go from being over heated to freezing in no time. The fluffy towel will help.
Next up is the Bad Ass Dash on July 18th in Nepean. Anyone interested in joining?


Wednesday, June 10, 2015

Video of PhoneGap Day EU 2015 - Push N' Pull Presentation

The video for my Push N' Pull presentation is now available.



If you want to get a copy of the slides please check out my previous post.