This article is the second in a series that will cover the steps to set up Apache Cordova for the Android, Windows and iOS platforms.
See the full list of platforms supported by Apache Cordova here.
In this article I’ll create a Windows Store App with the same Apache Cordova project I created in numero uno of this series.
Let’s get started!
- Install the Windows SDK for Windows 8.
I’m using Visual Studio 2013 with the Windows 8.1 SDK on a Windows 8.1 machine, and I did not have the Windows 8 SDK installed. I soon saw my Cordova Windows app target failing to build with an obscure message. I learned that at the time of this writing, Cordova needs the Windows 8 SDK, or it will not be able to compile your Windows app even if you already have the Windows 8.1 SDK installed.
- Add the Windows target to our HelloCordova app and build it:
cordova platform add windows
To see what platforms you have already added use:
cordova platform ls
Now build the Windows target with:
cordova build windows
- It’s that simple! Run the app!
cordova run windows
Since this is a Windows Store App, you will be prompted to acquire a Windows 8.1 developer license and a signing certificate. Microsoft has made this a simple once-a-month process and it’s free!
Cordova will be able to install and launch your app after the signed Windows Store App (with an .appx extension) is created.
This is our HelloCordova app on Windows 8.1 in it’s full-screen awesomeness.
You can even search for it in the Apps listing.
And here it is side-by-side along with my desktop.
Notice how the app has adapted to the change from full-screen mode.
When Windows 10 arrives, this Store App will exist on your desktop, just like any other Windows app.
So now, our HelloCordova project targets Windows and Android with the same code! Awesome!
Go forth and write responsive cross-platform apps!
I hope you enjoyed this article. Please leave me a note if you found it useful.