YouTube: How to Develop in Cordova & Deploy to Android

I've been experimenting a bit with Cordova development in NetBeans IDE. In this YouTube clip, I show you how to get started setting up Cordova, while here you see the creation of a new Cordova application, with deployment to an Android emulator:

However, as you see in the screencast above, the Android emulator is extremely slow. The web abounds with complaints about this, as well as information about Genymotion, the solution to the problem, since Genymotion is a really fast Android emulator.

Once you have a virtual machine set up, together with Genymotion, you're good to go. However, once you've created an APK file, i.e., an archive of an Android application, you need to use the ADB tool to deploy to Genymotion. To Simplify that, I created a small plugin, which adds an action to APK files for deploying to Genymotion. Here you see a small YouTube clip that aims to illustrate that Genymotion is really fast, I must say I was very impressed. Now the only slow part is the building of the APK file.

And here's the Action that uses the ADB tool to deploy to Genymotion.

        category = "Run",
        id = "org.nb.geny.model.Deploy2GenymotionAction"
        displayName = "Deploy to Genymotion"
        path = "Loaders/application/x-java-archive/Actions", 
        position = 1600)
public final class Deploy2GenymotionAction extends AbstractAction implements LookupListener {

    private Lookup.Result<DataObject> result;
    private DataObject context;

    public Deploy2GenymotionAction() {
        putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, true);
        result = Utilities.actionsGlobalContext().lookupResult(DataObject.class);
                WeakListeners.create(LookupListener.class, this, result));
        resultChanged(new LookupEvent(result));

    public void actionPerformed(ActionEvent ev) {
        try {
        } catch (InterruptedException ex) {
        } catch (ExecutionException ex) {

    public Integer execute() throws InterruptedException, ExecutionException {
        ExternalProcessBuilder processBuilder = new ExternalProcessBuilder("/usr/bin/adb").
        ExecutionDescriptor descriptor = new ExecutionDescriptor()
        ExecutionService service = ExecutionService.newService(
                "adb installation");
        Future<Integer> task =;
        return task.get();

    public boolean isEnabled() {
        return context.getPrimaryFile().getExt().equals("apk");

    public void resultChanged(LookupEvent le) {
        Collection<? extends DataObject> p = result.allInstances();
        if (p.size() == 1) {
            context = p.iterator().next();


And how can you add this action to Netbeans 7.4?

Posted by guest on February 02, 2014 at 02:40 AM PST #

Yes - as the previous comment, please tell us a bit more! New to NetBeans and Genymotion, but not Cordova/Android...

A few more 'for dummies' steps would be greatly appreciated, since this is the top current resource for getting the "dream team" suite of programs working...

Also - the audio is extremely faint on these videos, though other videos on YouTube are playing fine for me.

Thanks in advance.

Posted by potomac on March 09, 2014 at 02:56 PM PDT #

A bit more about what? Everything in this blog entry is about NetBeans IDE 7.4. What is it exactly that you want to know? How am I supposed to guess if you don't say what it is you want?

Posted by Geertjan on March 09, 2014 at 10:33 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« November 2015