Thursday, June 13, 2013

JavaFX NixieClock on iPad

Hi there,

This is just a very short BlogPost about some fun that I had today. Two days ago I decided to take a look at RoboVM from Niklas Therning which makes it possible to compile JavaFX code for iOS devices. And I have to say THANX to Niklas who did a great job in creating an OpenSource project that is so easy to use and works out of the box even with the 0.3-SNAPSHOT release.
Well this doesn't mean you can now start to port your business application to iOS BUT it's possible to start playing around with it. Because not everything is OpenSource in JDK8 at the moment (Font's and Media are still missing) you can't really create a lot of stuff but as long as you don't use fonts and media stuff you are good to go. Ok ok, effects also do not work for me at the moment but I don't care.
Yesterday at the Eclipse Demo Camp in Munich (which was great, btw thanx to Kai Toedter for the great event) I met to Tom Schindl from Best Solution and we talked about the RoboVM thing and I told him that I've put the BrickBreaker demo already on my iPad. After that short talk and a demo of the BrickBreaker game on the iPad emulator during Tom's session made me think about creating my own little app and compile it for my iPad. Well the biggest problem was that I can't use fonts and so I decided to create a version of the NixieClock for the iPad.
Today during the trainride back from Munich I started from scratch and first created the NixieTube control, after that I created a clock from it and prepared an Eclipse project (because there is an Eclipse plugin for RoboVM which makes compiling and deploying your iOS app very easy) and shortly before I arrived at home I made the first test...it failed. I figured out that with the latest JDK8 developer preview b93 RoboVM has problems. After I've put the kids to bed I had some time to try it again with b92. To get it running I had to do the complete drawing in code instead of css and also had to remove all dropshadows from the control.
But in the end it worked and now I have my sweet little NixieClock running on my iPad :)

For those of you that don't know the clock here is a screen shot of the clock running on my Mac...



Like I said this version was created completely from scratch during my trainride from Munich to Münster and here is the same clock running on my iPad...



As you can see the iPad version is missing the glow effect around the numbers and you could also see some rendering artifacts on the 1 for example but overall it's really nice that I could now compile my JavaFX code for my iPad...

Here is also a little video of the clock running on the Mac and the iPad...

Well I won't share the code here because it might change very quickly again but you could easily follow the instructions on Niklas blog and have some fun... :)

That's it for today...so keep coding...

1 comment:

  1. Awesome, congratulations!

    I didn't go this far yet. I just managed to compile the "simple iOS app" and let it run in the simulator. One caveat though: the Scala version ;-)

    https://gist.github.com/sebnozzi/5653898

    Keep up the good work!

    Sebastian

    ReplyDelete