Skip to main content

There is no JavaFX Mobile. There is only JavaFX.

Posted by joshy on February 5, 2009 at 1:44 PM PST

I know I haven't been blogging, twittering, or doing the FaceBook very much lately. That's because I've been very, very busy working. As we promised last summer, the next release of JavaFX coming out soon. For desktop developers you won't notice too many changes, mostly bug fixes (and a feature or two). The big news is that this will be our first release with full mobile support. Of course this really isn't news either, since it's what we promised last summer. In fact, mobile support has been the driver for this release. Pay attention for news coming out soon with the details. So with no news for you, why am I writing this blog?...

I'm running a sample JavaFX app on a demo phone (yes, a real phone). I won't tell you what phone it is but I will say that it has a very nice high resolution screen (no, it's not an iPhone). As I've been working with this device it struck me how easy it was to code for. And there's a very good reason for that. When you write JavaFX desktop apps with the common profile you are also writing for mobile devices. Desktop and mobile aren't different platforms. There is only one JavaFX. Even though there is no mobile emulator for Mac, I've done all of my mobile samples work on my Mac. I write my desktop apps to support window resizing, resize to the approximate size of a mobile device, then save my code. I only switch to Windows every now and then for a quick test in the real emulator. As long as I only use the common profile everything just works.

It struck me this morning how much of a big deal this is. I don't know anything about Java ME, but I know JavaFX. Even though I'm not a mobile developer I can write mobile apps with JavaFX. I couldn't do that before. One SDK, one set of tools, one language, one set of APIs. There is no JavaFX Mobile. There is only JavaFX.

Comments

Hi. A JavaFX newbie here. I was just waiting for a JavaFX Mobile SDK, But this post say I can start to develop now. I have a question: does NetBeans build a .jar Midlet compliant? Or what must I do to install a JavaFX app on my MIDP 2.0 phone?

@opinali - Didn't they have demos of JavaFX running on Android at JavaOne?

Is a public roadmap or a schedule for upcoming update releases available? I hope we don't have to wait til JavaOne ;)

Now the bis question is .... will this finally include *Linux* support. I develop using Netbeans on *Linux* so .. as long as the "write once run everywhere" promise is not hold I have to ignore it. By the way: in our company peaople use already flash which runs on the wanted platforms. A colleague of me running windows, showed me some of your JavaFX samples in the browser (some weather forcast if I am not wrong). Here I see at least one big weakness: I takes a long time to download, while a website using flash runs at once, without that the user notes a difference.

In another question that joshy probably can't tell even if he knowns of good news... I hope Sun is working on an Android port, because that platform seems to be building momentum (eg., see http://arstechnica.com/gadgets/news/2009/02/motorola-says-android-more-c...). I consider Android a big f*$kup in terms of fragmentation (many good ideas, but also many things different without reason that I can see; they could surely have made a much better job to reuse as much ME/SE APIs as reasonably possible but its crystal clear that they didn't even try to reuse any JavaME APIs). JavaFX would be a fine solution for that, allowing us to once again write at least a mostly-portable app (requiring different code for "backend" stuff like data access, comms / web services, PIM etc., but reusing all the GUI and media code - and for important niches like casual games, this is >95% of all code).

@mkarg, try the newer 6u12, I also remember some flicker and worse problems, e.g. when I'd scroll a webpage containing a JavaFX applet everything would be garbled - but I don't remember now if this problem was specific to 6u12-ea or if it happened to 6u11 too, and adding insult to injury, I'm also running latest Firefox 3.1 nightlies so it might even be a browser issue... probably not, because I noticed very clearly that the day I installed the final 6u12 build the problem went away. Notice though that high-framerate animations suffer inside browser pages, because the browser imposes significant overhead and trouble to host plugins. This affects both Java applets (Swing, JavaFX, whatever) and other embedded plugins like Flash. When you move the exact same applet out of the browser (possible in Java with the new 6u10+ dragging options or a more standard JAWS or application deploy), performance is always better and ssiues like flicker may improve. Notice though that JavaFX 1.0 has a limitation: its animation runtime can't V-sync, it can only approximate that by detecting your monitor's refresh rate and trying to maintain a "pulse" of similar frequency - check http://javafx-jira.kenai.com/browse/RT-1088.

Will JavaFX 1.1 solve the problem that all JavaFX samples are flickering and bumpy on my laptop (JRE 6u11), while the same machine runs all my nice native racing games smooth and silk?

@aalmiray yep, mobile can't haz swing. don't worry though, the new components are going to be great, and work everywhere.

@mikeazzi no, the HBox and VBox haven't been updated, but what you describe shouldn't be hard to write. I've been looking for a new small demo to code up. Could you email me the requirements offline (joshua.marinacci@sun.com). Thanks.

Phone? Is that the Nvidia phone? Drat, even if I'm right you can't tell me.

I was hoping to see some new features for 1.1 release, at least the basic ones listed on javafx-jira marina version. when can we expect the those features (gui comp./controls)? any time frame would be very helpful. btw, without a gui builder, it's a pain to develop large applications. any news about visual designer? will there be a beta/preview release? will it be GPL or commercial? plz give us a bit info since no one tells something about it

I think that best time to release the JavaFX mobile is perhaps after a version of JavaFX that has functionalities ready for real-world use like database access, gui components (JavaFX 2.0/1.5?) and when the desktop version of JavaFX meet with some real-world application success. Only then JavaFX could be marketed as viable solution to solving real need and expand to mobile and TV segment. Currently there is still vague direction of what realworld problem that current version of JavaFX is solving.

Ah there I see it, "When you write JavaFX desktop apps with the common profile you are also writing for mobile devices." so the common profile "cant haz Swing", right?

Hi Josh, would you happen to know whether this 1.1 release would include include any fixes to the HBox/VBox containers so that they would behave like true layout containers. Particularly the ability to auto expand/collapse when nodes are inserted/deleted in the middle of say, a VBox. I kind of need this functionality for a project I am working on. Thanks, Mike

@aalmiray - Josh was writing specifically about the common profile, as in, "When you write JavaFX desktop apps with the common profile you are also writing for mobile devices." The point is - there will be whole classes of apps where you can run the exactly same app on a phone, and in a browser. For example, there could be really huge opportunities here in casual gaming.. Now, if only there was great market place for JavaFX Mobile apps, I have this amazing new idea for a game called fxShoot. I won't say exactly what the game is, but it's gonna be massive ;-) That's if Josh doesn't write it first, and then quit his job ;-)

aalmiray no, there is no swing on mobile. Swing is in the desktop only profile. Mobile doesn't have Swing so there would be no way to support it. We are working on new components / layouts which will be in the common profile, but those aren't in this release except for the TextBox and VBox/HBox (which were there before).

Does that mean you'll be able to use Swing on mobile? (via SwingButton or SwingComponent.wrap)

Really looking forward to the JavaFX 1.1 announcement - interested to see what the support for FX Mobile is in the industry, and what can be done with JavaFX as of v1.1. Also hoping people have been working hard squashing bugs...

"... aalmiray no, there is no swing on mobile ... " ??? Java ME has an optional package for Advanced Graphics and User Interface Java 2Dâ„¢, Swing.