Close

Migrated Android companion app to Cordova

A project log for Watchduino2

Inexpensive Open Source BLE smartwach compatible with Arduino tooling

mar-bartolomeMar Bartolome 08/16/2015 at 11:050 Comments

As you know, much of the heavy lifting of the WatchDuino apps is actually not done in the watch itself, but on the phone. We made a framework for serializing and handling the bluetooth communications from and to the watch.

For WatchDuino to work, a companion app needs to be running on Android as a service. This companion app contains the messaging framework, plus the bit of logic for every phone app, that usually is in charge of querying some web service and producing a response with data to pass to the watch.

For the sake of debugging and testing, we made a simple interface to the companion app so that we can easily pair the devices, inspect all the messages going through, plus triggering notifications from each of the apps, or simply ping the watch to test the connection.

One of our biggest sources of frustration when developing WatchDuino2 has been working on the Android companion app. Android apps need to be programmed in Java, which is not a great language for rapid prototyping.

So we decided to switch to Apache Cordova (https://cordova.apache.org/) a couple months ago, which is a framework for writing Android apps as if they were web applications, by providing a set of libraries to access the mobile APIs from HTML5 and Javascript.

Being web developers we are much more comfortable with this kind of stack, so we migrated all of the functionality of the companion app to a new one written with Cordova.

Now we are able to make progress faster, with better code, and less bugs. Much win!

Discussions