JFXStudio: sketch, hack, share

iJavaFX Mobile

Posted by: Simon Brocklehurst on: February 22, 2009

vistascreenshot

I’ve been playing around figuring out what it will take to build mobile phone apps with compelling GUIs using JavaFX; including creating custom controls like the unlock slider idea, shown above, borrowed from the iPhone.  If you launch the demo, and unlock the “phone”, you’ll discover some “top secret” info!  That is, the identities of the very first JavaFX Mobile handsets that you’ll be able to get your hands on :-)

Herewith, some notes on my thoughts so far, with reference to the demo above.

What’s Easy

  • Creating custom UI controls designed for the particular characteristics of different handsets e.g. gesture-based controls, such as the unlock slider,  for touch screen devices
  • Creating the combinations of transparent gradients needed in, and around, controls so that they can fit elegantly together with other visually rich parts of the app, including end-user customizations such as gorgeous photographs
  • Creating custom controls with not only the look, but the feel that you want e.g. animating controls so they move out of the way when the user is done with them
  • Creating pretty transitions between “screens” of the app e.g.  fading in and out, or sliding content into place

What’s Tricky

  • Some graphical effects you might want to use may simply not be available on mobile devices because they’re part of the desktop profile e.g. the scanning spot light effect on “slide to unlock”
  • Some effects you might want to use are in the common profile, but actually not work on mobile.  For example the “clip” attribute on nodes is in the common profile, but is documented as “common conditional clip”.  What that means in practice is that you cannot rely on it to work on mobile.  In the demo, I used clip to make the “slide to unlock” text wipe away as the slider moves across.
  • Text rendering – getting text to render equivalently cross-platform is not a trivial problem.   It would be nice if the JavaFX platform did the hard work for developers.  If it does, I’m not aware that it does.   You’ll notice that the “slide to unlock” text in the screen shot below is incorrectly placed – it should be slightly lower down.  That’s on a Mac.  Whereas, on Vista, the text is in the correct position (see the Vista screen shot at the top of the blog).

custommobilescreenshot

The bottom line of my thoughts so far is – it’s going to be pretty easy to create apps with gorgeous UIs using JavaFX Mobile.    However, you do have to keep a close eye on the documentation to understand what’s going to work, and what’s not. Even looking to see if something is in the JavaFX common profile may not be enough in some cases – as I found with the “clip” effect above.  Rendering text could turn out to be a headache – and will need further experiments to see if the rendering challenges can be solved in elegant way.

Overall, I think the possiblities that JavaFX offers for mobile software development are pretty exciting…

Tags:

11 Responses to "iJavaFX Mobile"

[...] iJavaFX Mobile Posted February 22, 2009 [...]

Is this s’possed to work on Linux? It doesn’t load….

Guy,

It works for me on Linux (Ubuntu, running Java 6 Update 12). Do you get an error message of any kind? Or does it just fail silently for you?

Having said that, for some reason my Linux Java Web Start isn’t properly configured at the moment – so, to run any Web Start app on Linux, I have to do the following:

- Save the JNLP file to disk
- Run Web Start from the command line i.e. type:

javaws filename

Simon,

Re: your centered text problem on the Mac. Are you accounting for minY when centering?

translateY: bind (shape.height – text.layoutBounds.height) / 2 – text.layoutBounds.minY

Text on a Mac often has a non-zero minY.

Dean

@Dean, thanks for that – I’ll try it. Do you have any other tips for making fonts render similarly cross-platform?

Hello,
I m new to JavaFX and wanting to learn this language. Exploring through the web pages I found your application and I think it is wonderful. Could you post the source code and guide me how to learn JavaFX application building.

how do you lock it again? =D

There some more website offering unlocking solutions in cheapest price
check our unlockuriphone.com

Hi there!

I’m also developing an mobile app, and I really need to use the clip attribute, for clipping out a VBox.
But I’m afraid I can’t get it to work…

Could you please explain how you did the text clipping in your version?

Thanks,

Ramin

Hi Ramin,

Can I refer you to this text in the blog?

“The “clip” attribute on nodes is in the common profile, but is documented as “common conditional clip”. What that means in practice is that you cannot rely on it to work on mobile.”

So, unfortunately, the message is – don’t use clip for mobile apps. It’s a shame, but that’s the way it is right now. If you need that kind of effect, you’ll need to find a different way of doing it.

Hi,

I Cant load the demo. I get the following problem:

com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://dl.javafx.com/javafx-rt__V1.1.1.jar

Leave a Reply

Tags