Feeds

Surreal appeal of Sun's JavaFX for mobile

Java ME a safer bet?

3 Big data security analytics techniques

Review It's somehow fitting that Sun Microsystems chose Barcelona, the home of modernist architect Gaudí and this week's Mobile World Congress, to announce JavaFX Mobile 1.0 - part of the JavaFX SDK 1.1 release.

Just like Gaudí's work, there's something wavy, colorful and even surreal about Sun's shining new hope for Java. I've never seen such a show of strength mixed with this much diffidence. Sun is evidently desperate for developers to like JavaFX.

Consistency of message, though, is not Sun strong point. Here it claims there exists 2.1 billion Java-based handsets, but here it's gone for 2.6b billion, adding that eight out of 10 cats, sorry handsets, shipped in 2008 were running Java technology. That's a discrepancy of some 500 million mobile phones.

But whichever data you subscribe to, it's a compelling notion that a brand-new, graphically oriented scripting language could have this kind of installed base already at launch.

Momentously, Sun has offered JavaFX 1.1 plug-ins for both Sun's own NetBeans platform and rival development ecosystem Eclipse. But there's still no sign of a GUI editor anywhere. Major lack of kudos to Sun until this vital component, which should have been there from the beginning, eventually arrives.

NetBeans does at least provide a Mobile Emulator, with two sample devices pre-installed: an FX Phone and an FX Touch Phone. The latter emulator is shown in the screenshot below, rotated counterclockwise - shades of iPhone envy there from Sun, methinks.

JavaFX Mobile emulator

If you can touch it like an iPhone, and turn it like an iPhone...

Another mobile demo impressively shows how Java Micro Edition (Java ME) now provides access to your mobile phone's accelerometer. Developers will soon be swinging their phones like Wiimotes while the garbage collector stutters to catch up.

To achieve this, the demo delves into the javax.microedition.sensor package, viz the following JavaFX code:

var sensors = SensorManager.findSensors("acceleration", null);

And then the function to get acceleration data (called by a Timeline every 100ms) is as simple as this:

function getData():Void {
    if(accelInfo.getDataType() == ChannelInfo.TYPE_DOUBLE) {
        var data: Data[] = accelConn.getData(1);
        axisX = data[0].getDoubleValues()[0];
        axisY = data[1].getDoubleValues()[0];
        axisZ = data[2].getDoubleValues()[0];
    }
}

This is a good example of how JavaFX gains much of its power by leveraging the underlying Java software stack. Other underlying phone features are similarly exposed, such as address book, Bluetooth, camera, messaging, location, and payment.

JavaFX Mobile apps will, in theory, run on existing Java ME phones, but will require an initial download of the new platform libraries. Sun, though, has been aggressively partnering with a number of handset, carrier and mobile software partners, including LG and Sony Ericsson - though notably not yet Nokia or Samsung - to preinstall the libraries on new phones.

A major criticism of Java ME has always been the fragmentation. It's never been possible to simply write a Java ME midlet, test it on a few phones, and safely assume that it'll therefore run everywhere. Hacks and workarounds need to be factored in for pretty much each model you want to support.

Top three mobile application threats

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Batten down the hatches, Ubuntu 14.04 LTS due in TWO DAYS
Admins dab straining server brows in advance of Trusty Tahr's long-term support landing
Inside the Hekaton: SQL Server 2014's database engine deconstructed
Nadella's database sqares the circle of cheap memory vs speed
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
Windows 8.1, which you probably haven't upgraded to yet, ALREADY OBSOLETE
Pre-Update versions of new Windows version will no longer support patches
IRS boss on XP migration: 'Classic fix the airplane while you're flying it attempt'
Plus: Condoleezza Rice at Dropbox 'maybe she can find ... weapons of mass destruction'
prev story

Whitepapers

Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
SANS - Survey on application security programs
In this whitepaper learn about the state of application security programs and practices of 488 surveyed respondents, and discover how mature and effective these programs are.