JavaFX on iOS & Android?

JavaFX does not currently support iOS or Android, but the possibility has been subject to much hopeful speculation. One recent example is Felix Bembrick’s manifesto Six Degrees of Separation. What strikes me as odd is that people still seem to expect Oracle to deliver such ports. True, there was an announcement regarding open-sourcing “JavaFX on iOS and Android” which generated much excitement, but Richard Bair had quickly clarified the actual situation even back in February:

A few years ago at JavaOne 2011 we showed a demo of JavaFX running on Android and iOS devices. This was a proof-of-concept which has two essential elements. The first is a port of the Windowing / Graphics layer of JavaFX (Glass & Prism) to use iOS & Android APIs. This is what we are open-sourcing, nothing more nor less. We are not providing a JVM for these platforms, nor am I aware of any such plan, so it’s not in any way a complete solution. Nor do we have a plan for releasing these ports in any release. We’re just opening up JavaFX code to the Java community for further experimentation.

This means Oracle won’t do anything about iOS or Android, except contribute a preliminary port of Glass & Prism. The OpenJDK community must provide the substantial missing pieces: support to run JavaFX in the first place, plus enhancing the desktop-oriented JavaFX library with device-specific functionality. Contributors are already hard at work, but so far nothing is ready for public consumption even by average developers, let alone end users.

The absence of iOS/Android news from the recent JavaOne 2013 conference appears to confirm that Oracle’s intentions are still unchanged. So why don’t they care about such ports? Most likely because there’s no commercial benefit. As Sebastian commented:

It is hard to do really well, and it may simply not be worth the effort. The company would have to dedicate a sizable team of developers, working closely with Apple and Google (not bloody likely), and the result would be a second-rate way to develop iOS and Android apps that would forever be playing catch-up with the fast-moving targets that these platforms are, instead of doing much GUI innovation itself. And it would hold no appeal at all for committed developers wanting to build top-notch mobile apps, because they would learn and use the native APIs, because that’s what you do.

So what’s JavaFX good for, as far as Oracle is concerned? The company maintains a showcase of real-world JavaFX use cases, including ferry management and even facial surgery planning. As far as I can tell, these are all enterprise solutions that target fixed PC installations rather than arbitrary consumer devices. (Certainly, you don’t need to worry about annoyances like faulty DPI scaling if you’re only dealing with fixed screen resolutions!) Developer tools are another area where JavaFX would benefit Oracle directly – but obviously that’s no motivation for app store support, either.

That doesn’t mean Oracle won’t care about JavaFX on mobile platforms at all, but those platforms would be Windows or Linux tablets, or else custom-built devices such as the DukePad demoed at JavaOne. The DukePad is powered by Raspberry Pi which is already supported in OpenJFX, the open-source project behind JavaFX. Nice perspectives for custom embedded development, and that’s clearly where Oracle’s interests lie – not in app store deployment to a zoo of consumer devices controlled by (rather hostile) third parties.

Oracle isn’t in the business of making stand-alone consumer applications, after all, and there’s no lack of choices for building mobile front-ends. Besides platform-native development and HTML/JavaScript, popular cross-platform frameworks include Unity (for games) and Xamarin (for everything else). Indeed, it’s not clear that any substantial number of iOS/Android developers would use JavaFX even if it were available. Oracle’s own ADF Mobile framework simply combines a Java back-end with an HTML front-end.

Will we ever see JavaFX for app store deployment on iOS and/or Android? The remarkable success of relatively small companies like Unity and Xamarin indicates that the difficulties are not insurmountable. The real question is now whether there’s enough interest in the OpenJFX community to complete the ports, ensure they work on all contemporary device variations and OS revisions, and keep them working in the future. Time will tell…

2013-10-22: Richard Bair has posted an extensive status update regarding JavaFX on iOS (he doesn’t mention Android as far as I can tell). No real surprises there, but a lot of details regarding the current prototype implementation and what remains to be done.

2015-08-20: Johan Vos and partners have set up a new company called Gluon which maintains the open-source JavaFXPorts, a third-party port of JavaFX to mobile and tablets. That’s certainly more promising than an unpaid volunteer effort, although Oracle is still not involved. Gluon also offers related commercial products and services.

17 thoughts on “JavaFX on iOS & Android?”

  1. It’s a bit of a cliche but I think we can frame this discussion within the context of the Glass Half Empty (GHE) versus Glass Half Full (GHF) approach. At least when it comes to JavaFX on iOS and Android, both you and Sebastian seem to be in the GHE camp and it seems that the much of the general public fall into the same category.

    Well, not me. I am definitely a GHF kinda guy and especially so in regards to this issue.

    The main points being presented by both yourself and Sebastian seem to be that firstly it is just too hard to make such a port viable and secondly that Oracle has no interest in it because it won’t generate any revenue.

    On point (1), the GHE approach is to dismiss the possibility of a viable port on the basis of the fact that Swing “native” look and feels never managed to quite provide the native experience and on the basis of the fact that such a port would always be playing catch-up as the OS evolves.

    On the contrary, the GHF approach is to say that firstly JavaFX is not Swing so we cannot condemn it on that basis alone. Also, the task of making the port viable is most definitely difficult but given that the UI on each platform is very clearly defined and that we are not talking about anything of a level of complexity that renders it beyond the realms of possibility, I feel that with the appropriate amount of dedication JavaFX *can* succeed where others have failed. And on the point of “catch-up”, I totally refute this because this is little different from native app development where the OS API is constantly evolving. The solution there is the same as the solution here which is basically to get access to pre-release versions of the OS and have a fully compatible product ready the day the GA release of the OS is published.

    Now, on the point of little or no revenue coming Oracle’s way directly from JavaFX, the GHE approach is to believe that JavaFX on iOS and Android *has* to generate revenue for Oracle to be interested in it. The GHF approach is to recognise that this is total fallacy and I’ll tell you why…

    When you go to buy a car, you go to a car dealer whose core business is selling cars… right? Wrong! The car dealer’s core business is actually servicing cars and selling spare parts. Most dealers actually make a *loss* on the sale of vehicles themselves and make the vast majority of their revenue and profits from servicing the cars and through selling spare parts to maintain them. The selling of cars is just a tool to enable their core business to exist.

    And it’s the same with Oracle and JavaFX on iOS and Android. Their core business is in licensing Java for embedded platforms and that is why you see so much focus on JavaFX on Raspberry Pi for example and an “official” JDK8 release for such hardware devices. However, for JavaFX to succeed long-term and be a viable technology into the future it *has* to run on the devices that most people already use namely mobile phones and tablets.

    Having JavaFX run on these platforms is akin to selling vehicles in my example whereas licensing Java on embedded platforms is the core business. One enables the other.

    1. I agree that JavaFX on iOS and/or Android is certainly not technically impossible. Offering a demonstration of JavaFX’s mobile capabilities is a plausible motivation, too. However, all signs indicate that Oracle has already made up its corporate mind on that account and deemed the effort not worthwhile, likely for the reasons I tried to outline here. You’d have to convince Larry Ellison otherwise, if you can pry him away from his yachts and mansions for a second. Or even better, contribute to the OpenJFX effort!

  2. A quick look at the bug database for JavaFX shows that the team is actively developing JavaFX for IOS and Android, with regular bug fixes and performance improvements being tested on IPhone and IPads.

    I can’t guarantee they will release JavaFX for iOS and android but it appears they are currently doing all the work necessary to do so, and are very well advanced on the task.

  3. @Christoph, I disagree completely that Oracle is not interested. There has been a flurry of activity in the OpenJFX world that indicates quite clearly that they are doing a lot of work in this area (as supported by Bob’s findings). And the very fact that they had a number of sessions planned for last month’s JavaOne with “iOS” and “Android” in their titles that were cancelled at the last minute shows that they at least thought they could have something to demo at that time but that they had to postpone for whatever reason.

    I personally am *very* optimistic about the future of JavaFX which means that it will be successfully ported to iOS and Android in line with the 6 Degrees of Separation that I posted on my blog and you referred to.

    I am also confident that this will happen sooner rather than later…

    Felix Bembrick (@Lucan1d)

  4. I’m not optimistic. Please read all the stuff from Richard Blair. Oracle has contributed JavaFX prism and glass port for iOS and Android to the community, but they will never open source a VM for Android and iOS.

  5. According to a mentor that helps me with Objectwheel with a first name … (can’t say) . He was in a hotel room with 3 other guys and one of them was flown in to show a Javafx chess demo on an IPAD exactly like we saw at Javaone 2013 on the Rasberri pi. . At the very last minute, Lawyers cancelled this part of the demo. He gave me the guys name and I tried to pry more information but I didn’t want to get anybody in trouble. Apparently this demo a full blown IOS chess app and it wasn’t using robovm. This person was a very high up Sun Employee for years and is very credible. This would also explain cancelled IOS and Android sessions.

    1. Interesting. Note that if the demo wasn’t using RoboVM or a similar native compilation scheme, Apple would not allow its deployment to the official App Store. Possibly Oracle was wrestling with Apple behind the scenes to allow running the actual Java VM on iOS?

      To clarify, I never doubted that Oracle can already deploy JavaFX prototypes to specific customized Apple or Android devices… it’s conformance with app store rules, end user expectations, and the variety of devices in the wild that I’m dubious about. You don’t have this kind of problems on Raspberry Pi.

  6. @Christoph – yes, it’s a big ask… but it *is* achievable. And just imagine if they do it. One language to deploy everywhere… desktop, mobile, tablet, IoT… that’s what’s called a Game Changer!

  7. . They have many internal demos.
    . The JavaFX teams is working on it.
    . They don’t want to show anything yet.
    => big annonce: Java 8 + JavaFX 8 + iOS and Android support, all at the same time !

    Oracle is back and Google is stuck with an older Java (no lambdas)
    Seems (too?) obvious to me.

    1. big annonce: Java 8 + JavaFX 8 + iOS and Android support, all at the same time !

      Five years later, I have to ask… how did it go with JavaFX on iOS?

  8. @Mike I am making the same gamble and I can sleep at night. I believe Olivier is correct. If he is wrong (and I am wrong) then I am also extinct ;-)

Leave a Reply to Christoph Nahr Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.