Eclipse Thym for Apache Cordova Tooling

The JBoss Tools team wanted to get good support for doing development with Apache Cordova in Eclipse. Apache Cordova offers a hybrid mobile development model where you are using HTML5 technologies mixed in with a native container on the mobile device. This container gives you access to native features like camera, microphone, motion sensor etc. while just using one codebase instead of having different one for Android, iOS, etc.

When starting, we looked at the available tools for developing Cordova applications. We found out that there were no open source solutions that we could contribute and use as part of our tools. Furthermore, interoperability among what very little existed was poor. Of course, our main goal is creating good tools for Apache Cordova development, but while doing that we always keep an eye on interoperability and extendibility.

That work started in 2013 and in July 2014 we moved the development of our tools for Cordova based application development and formed the Eclipse THyM project.

Trying out THym today

THym is planned to be part of Eclipse Mars release in 2015.

THym includes Project wizards, project management, plugin discovery, and support for running iOS and Android simulators.

You can use THym update site directly, but in the walkthrough below we will JBoss Developer Studio which have Thym included and some extra value add-ons like the Cordova Simulator.

JBoss Developer Studio 8 and JBoss Tools 4.2 release enables developers to use these tools to build mobile applications by using the Apache Cordova framework. Here, we will explore different scenarios for getting started with the tools and Apache Cordova.

Where are the tools?

Once you have downloaded and installed JBoss Developer Studio 8 or installed from Eclipse Marketplace Hybrid mobile tools are available from JBoss Central to pull them in. Here is how.

First switch to Software/Update tab on JBoss Central. Next select JBoss Hybrid Mobile Tools + CordovaSim . You can select the AngularJS for Web Tools option before hitting the btn:[Install/Update], in order to get the improved support for Ionic framework.

Here is a screeen cast for getting started with the hybrid mobile tools.

1. Start a new Cordova project

This is the option when starting a new project or just experimenting with Apache Cordova development.It gives a basic project template that you can easily change and you can select the initial set of cordova plug-ins to include into your project. I usually add the console plugin at this time, to be able to use console.log() during development and remove it before the final export.

The video above not only shows how a project is created but also introduces the tools at your disposal going forward.

2. Import your existing Cordova application

If your Cordova application already exists and it was developed using a compatible tool such as Cordova CLI, you can import it easily and start using all the functionality available. Import process will also restore your plugins if you have been using the new cordova save command.

Here is a short video that shows the import feature in action.

3. Use existing mobile web site code

Often getting started with your packaged mobile application requires sharing the assets with a web application. We do support linking of resources from different locations to create a Cordova based mobile application. Although I do not recommend using artifacts, let alone whole web sites, that were created for desktop to be turned to mobile applications, but it helps to know that your tools are capable when it gets desperate.

Where is the code

The development for THyM happens on GitHub in the https://github.com/eclipse/thymrepository.

We use bugzilla, and thym-dev mailing list and project documentation is at the wiki. The builds will be running on eclipse.org build server instance.

About the Authors

max rydahl andersen

Max Rydahl Andersen
Red Hat

ed merks

Gorkem Ercan
Red Hat