Going cross-platform with Apache Cordova for Visual Studio 2015

OSS&Microsoft Banner

Welcome to our weekly MVP series where we discuss some of the most useful solutions, tips & tricks and how to’s on integrating OSS & Microsoft technologies. In case you have any questions, don’t hesitate and drop us a comment below or reach out to us via Twitter and Facebook! Enjoy!

Another open source project in the Visual Studio 2015 tool belt is Apache Cordova. Cordova is an open source, cross-platform tool, which allows development of mobile applications using HTML5, CSS, JavaScript and Web development tools. Cordova gives JavaScript apps an ability to access native device APIs (camera, storage, sensors) and abstracts those APIs to help with code reuse across multiple platforms.

Similar to GitHub Extension (Part 1), Apache Cordova is incorporated as an optional feature in the Visual Studio installer.

image

To support Apache Cordova, Visual Studio installer adds two new project templates – for JavaScript and TypeScript apps.

image

Both templates create simple projects, wire dependencies and provide an instruction on the following steps – all what you can expect from the Visual Studio New Project wizard.

Apache Cordova Tools for Visual Studio also include configuration editor (activated by double clicking on config.xml) which allows to setup target platforms and add platform integration plug-ins.

image

However, Visual Studio does not stop here – it also provides a rich experience for testing and debugging Cordova apps with the Android emulators. One of the emulators is developed by Microsoft and it is a fully featured emulator that allows to test accelerometer, location, camera and other platform services. Look, feel and feature set of this emulator will be very familiar for the Windows Phone developers.

image

Cordova application can be attached to any of the supported emulators, not just the Microsoft one, providing an ability to debug JavaScript, set the breakpoints, inspect variables, etc.

image

This experience is possible because of the various open source tools, such as Node.js and Apache Ripple, which are chained together and integrated with Visual Studio.

What’s next

If you are interested in cross-platform development and have an experience with Web technologies, combination of Visual Studio 2015 and Apache Cordova is a jump start towards your app. Apache Cordova is supported by the Community edition of Visual Studio 2015, so as an individual developer you can try these tools for free, using benefits of both excellent Visual Studio IDE and vibrant open source community.