Search code examples
javajavafxjavafx-2

Is it possible to run JavaFX applications on iOS, Android or Windows Phone 8?


Can one develop an entire application using JavaFX and run it on iOS, Android or Windows Phone 8, without writing platform-specific code?


Solution

  • Background

    Invariant's answer is a good resource for how everything was started and what was the state of JavaFX on embedded and mobile in beginning of 2014. But, a lot has changed since then and the users who stumble on this thread do not get the updated information.

    Most of my points are related to Invariant's answer, so I would suggest to go through it first.

    Current Status of JavaFX on Mobile / Embedded

    UPDATE

    JavaFXPorts has been deprecated. Gluon Mobile now uses GraalVM underneath. There are multiple advantages of using GraalVM. Please check this blogpost from Gluon. The IDE plugins have been updated to use Gluon Client plugins which leverages GraalVM to AOT compile applications for Android/iOS.

    Old answer with JavaFXPorts

    Some bad news first:

    Now, some good news:

    • JavaFX still runs on Android, iOS and most of the Embedded devices
    • JavaFXPorts SDK for android, iOS and embedded devices can be downloaded from here
    • JavaFXPorts project is still thriving and it is easier than ever to run JavaFX on mobile devices, all thanks to the IDE plugins that is built on top of these SDKs and gets you started in a few minutes without the hassle of installing any SDK
    • JavaFX 3D is now supported on mobile devices
    • GluonVM to replace RoboVM enabling Java 9 support for mobile developers. Yes, you heard it right.
    • Mobile Project has been launched by Oracle to support JDK on all major mobile platforms. It should support JavaFX as well ;)

    How to get started

    If you are not the DIY kind, I would suggest to install the IDE plugin on your favourite IDE and get started.

    Most of the documentation on how to get started can be found here and some of the samples can be found here.