118

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

cubuspl42
  • 7,833
  • 4
  • 41
  • 65
mjs
  • 21,431
  • 31
  • 118
  • 200
  • 1
    I don't think so. Look here : http://news.kynosarges.org/2013/10/10/javafx-on-ios-android/ – Viktor K. Dec 31 '13 at 17:26
  • 1
    Oracle develop ADF mobile. Look at this. It supports iOS and android. – Alexander Kirov Dec 31 '13 at 19:03
  • Just look for the word javafxports on the www. Most of javafx features work fine on windows/android/iOS. At this moment, there are a few features not working yet on android such as: Task.cancel() or international unicode characters, or the fx media player, etc. – Amin May 04 '16 at 06:23

5 Answers5

78

Yes you can run JavaFX application on iOS, android, desktop, RaspberryPI (no windows8 mobile yet).

Work in Action :

We did it! JavaFX8 multimedia project on iPad, Android, Windows and Mac!

JavaFX Everywhere

Ensemble8 Javafx8 Android Demo

My Sample JavaFX application Running on Raspberry Pi

My Sample Application Running on Android

JavaFX on iOS and Android

Dev Resources :

Android :

Building and deploying JavaFX Applications on Android

iOS :

NetBeans support for JavaFX for iOS is out!

Develop a JavaFX + iOS app with RoboVM + e(fx)clipse tools in 10 minutes

If you are going to develop serious applications here is some more info

Misc :

At present for JavaFX Oracle priority list is Desktop (Mac,windows,linux) and Embedded (Raspberry Pi, beagle Board etc) .For iOS/android oracle done most of the hardwork and opnesourced javafxports of these platforms as part of OpenJFX ,but there is no JVM from oracle for ios/android.Community is putting all together by filling missing piece(JVM) for ios/android,Community made good progress in running JavaFX on ios (RoboVM) / android(DalvikVM). If you want you can also contribute to the community by sponsoring (Become a RoboVM sponsor) or start developing apps and report issues.

Edit 06/23/2014 :

Johan Vos created a website for javafx ports JavaFX on Mobile and Tablets,check this for updated info ..

Community
  • 1
  • 1
invariant
  • 8,758
  • 9
  • 47
  • 61
70

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.

ItachiUchiha
  • 36,135
  • 10
  • 122
  • 176
  • I am not sure when you last used JavaFX but a lot of improvements has gone in JavaFX 8. A lot has a also changed from initial JavaFXPorts to Gluon Mobile. – ItachiUchiha Nov 04 '16 at 19:49
  • Thank you for this update. Quick question, is JavaFXPorts free to use for commercial purposes (using the library, not altering it)? I have a JavaFX codebase I'm hoping to integrate into Android somehow. Gluon Mobile offers a free trial, but I need a permanent solution. Is JavaFXPorts (not Gluon Mobile) the solution? Please clarify – Nova Dec 16 '16 at 02:37
  • @Nova Hi. Yes, [JavaFXPorts is under GPLv2 + CLASSPATH exception](https://bitbucket.org/javafxports/8u-dev-rt/src/3d097c1c0336256b16eeebdb7eefc8a438e458e1/LICENSE?at=default&fileviewer=file-view-default#LICENSE-326) so you can use it in your project without worrying. But, since JavaFXPorts just gives you a bare minimum support (no IDE support+no Mobile controls), I would be skeptical to choose it for something commercial. Gluon Mobile is free to use, it just has an Nag screen when your application starts (for free version). But, you can get rid of it when your app is famous by paying a fee :) – ItachiUchiha Dec 21 '16 at 06:44
  • @ItachiUchiha that sounds promising! One last question: The comparison of Gluon Mobile products found [here](http://gluonhq.com/products/mobile/buy/) shows the nag screen is the only difference between the free tier and Indie tier. Is it safe to assume that I can use the free version for commercial use, for unlimited time? As in, no expiration date? I can handle the nag screen until the funds roll in :) Thanks for clarifying – Nova Dec 22 '16 at 13:19
  • 1
    Sorry, one more question: My JavaFX code is 90% complete with 20,000+ lines of code. Can I still integrate Gluon Mobile into my codebase... or do I need to use it from the very beginning, before I write a single line? Thx – Nova Dec 22 '16 at 13:23
  • @Nova Yes, you can use the free version for commercial purpose. Answering your second question, you can integrate Gluon Mobile into your codebase but you might have to tweak screens created for Desktop so that they look acceptable on Mobile and while doing so, you will use a few features provided by GM. – ItachiUchiha Dec 22 '16 at 21:27
4

Desktop: first-class support

Oracle JavaFX from Java SE supports only OS X (macOS), GNU/Linux and Microsoft Windows. On these platforms, JavaFX applications are typically run on JVM from Java SE or OpenJDK.

Android: should work

There is also a JavaFXPorts project, which is an open-source project sponsored by a third-party. It aims to port JavaFX library to Android and iOS.

On Android, this library can be used like any other Java library; the JVM bytecode is compiled to Dalvik bytecode. It's what people mean by saying that "Android runs Java".

iOS: status not clear

On iOS, situation is a bit more complex, as neither Java SE nor OpenJDK supports Apple mobile devices. Till recently, the only sensible option was to use RoboVM ahead-of-time Java compiler for iOS. Unfortunately, on 15 April 2015, RoboVM project was shut down.

One possible alternative is Intel's Multi-OS Engine. Till recently, it was a proprietary technology, but on 11 August 2016 it was open-sourced. Although it can be possible to compile an iOS JavaFX app using JavaFXPorts' JavaFX implementation, there is no evidence for that so far. As you can see, the situation is dynamically changing, and this answer will be hopefully updated when new information is available.

Windows Phone: no support

With Windows Phone it's simple: there is no JavaFX support of any kind.

Community
  • 1
  • 1
cubuspl42
  • 7,833
  • 4
  • 41
  • 65
2

Possible. You can get commercial sport also.

JavaFXPorts is the name of the open source project maintained by Gluon that develops the code necessary for Java and JavaFX to run well on mobile and embedded hardware. The goal of this project is to contribute as much back to the OpenJFX project wherever possible, and when not possible, to maintain the minimal number of changes necessary to enable the goals of JavaFXPorts. Gluon takes the JavaFXPorts source code and compiles it into binaries ready for deployment onto iOS, Android, and embedded hardware. The JavaFXPorts builds are freely available on this website for all developers.

http://gluonhq.com/labs/javafxports/

jeton
  • 841
  • 12
  • 15
-4
  1. yes you can run it on iOS and Android (Win8 is not supported!
  2. no deployment as a web-app does not work
tomsontom
  • 5,856
  • 2
  • 23
  • 21