Testing Cordova Apps on Your BlackBerry 10 Phone

Apache Cordova, better known as PhoneGap, Adobe’s commercialized edition of Cordova, allows developers to create apps for a variety of platforms using a single HTML5, CSS and JavaScript code base. This approach of cross-platform development works for all established mobile platforms and doesn’t stop at exotic ones, such as BlackBerry 10.

Despite its infinitesimal market share, there are valid reasons to target the BlackBerry 10 platform. Adding BlackBerry 10 as a target platform to a Cordova-based project is as easy as running the cordova platform add blackberry10 command on your terminal. However, if you try to deploy your app to the device and run cordova run blackberry10, you might stumble upon the following error message:

blackberry-nativepackager cannot be found on the path. Aborting.

It seems as if we are missing the native platform SDK here. In this article, I want to show you which steps are required in order to successfully run and debug your Cordova-based app on your BlackBerry 10 phone. Please note that I’m using OS X, so the exact steps may and will differ on other platforms.

Note: macOS 10.12 Sierra does not support the BlackBerry Link drivers required to connect to your device.

Continue reading Testing Cordova Apps on Your BlackBerry 10 Phone

Looking Back: AngularJS, Cordova and the Windows Phone Back Button

Recently we brought a Cordova-based web app which already runs successfully on iOS and Android to Windows Phone 8.1. One of the issues you will definitely come across when porting your app to this platform is the handling of the back button, an essential part of Windows Phone’s user experience.

By default, pressing the back button on Windows Phone closes your Cordova-based app, regardless of the current state. Instead, the back button should bring you back to the previous view; except on the main page, where pressing it must suspend the current app (according to the Windows Store Policies, 10.4.4):

Where applicable, pressing the back button should take the user to a previous page/dialog. If the user presses the back button on the first page of the app, then the app terminates (unless it is allowed to run in the background).

Not respecting those policies may not only lead to a rejection of your app, but also to bad ratings in the Store.

Continue reading Looking Back: AngularJS, Cordova and the Windows Phone Back Button