Multi platform Music notation with Haxe NME – part 2 – Android

Posted on December 30, 2012


Yay! My music notation solution, created using the great Haxe langugage with the multiplatform NME extension, is now up and running on Android units! 🙂

Here’s a screenshot from my brand new Andersson ADT 1.0 (7 inch display, 1200 x 800, 16 GB, Android 4.1.1):


And here’s a photo of my old HTC Desire phone (Android 2.2):


So now I can target flash, html5, windows (c++ and neko) and Android from one single code base, just switching the target – amazing! Still iOS to go – quite a leap to jump as I’m developing on Windows platform, but it seems to be possible using a virtual osx installation… We’ll see.

NME Android setup

Getting started on Android wasn’t that hard. I followed this setup information: with one exception: I didn’t use the default installation folder names that was suggested by haxelib setup android (“C:\Development\Apache Ant” etc), sinstead I choose 8.3 safe paths (“C:\dev\ant”) – just in case… (Ant is recognized to be a bit picky on this kind of stuff.)

Java gotcha

I just had one real problem that took some time to solve: In spite of making sure that my JAVA_HOME environment variable was correctly set, Ant kept complaining about that… This really puzzled me, until I found the solultion in a StackOverflow post: There was a java.exe and javac.exe lurking in the C:\Windows\System32 folder, that somehow fooled Ant. After deleting them, the compilation process worked as expected, generating the resulting .apk files.

Testing using BlueStacks

At first, I tried to get a ADT Virtual Device going for testing my solutions, but I didn’t manage to get anything displayed at all that way. Instead I try my solutions using BlueStacks (, a super easy-to-use virtual Android machine that seems to handle pretty much anything thrown at it. Just right-clicking my .apk file from the explorer, and choosing the Open with BlueStacks APK Installer option.

Installation on devices

This far, I’ve installed the solutions on my Android hardware devices by mounting them as drives to my development computer, manually copying the .apk file to a suitable device folder. After that, I use a file manager on my device to find and click on the .apk file, wich is then re-installed on the device. Not a very hi-tech deployment solution, but it works! 🙂