Monday Jul 20, 2009

Java ME: Bluetooth or NFC ?

Most new feature phones now have Bluetooth, and so most support the Java APIs to allow Java (and JavaFX) applications to drive it. And as you can see in this survey of Java ME tools, all the major development tools for Java ME phones support the APIs too. You may also have noticed some rather naughty uses of it too.

When the phone manufacturers finish up the next version of Java ME for feature phones, more of them will support Near Field Communication (NFC).

Leaving applications that need to transfer things like love notes, wedding invitations, baby photos (possibly in that order) a choice of whether to use Bluetooth or NFC to do it.

Check out this article to see the merits of each approach.

Friday Jul 17, 2009

When JavaFX and physics collide

Just some Friday fun.

Phys2D is a Java library that models the mathematics of physical objects. Run this webstart demo to see. Fun, huh ?

Now apply it to shopping, use it from JavaFX, and here's what you get.

Thursday Jul 16, 2009

Summarizing Java language changes for JDK 7

There haven't any changes to the Java language since J2SE 5.0 in 2004. But there are several planned for JDK 7, coming from a variety of sources (sic). Here's a quick summary:

1) Module support. Known historially as superpackages, though they are assuredly not, this promises to sit atop a variety of module systems to let developers partition big chunks of code more effectively.

2) Type Annotations. Step three in the popular annotations program, this hopes to further extend the reach of attaching meta-data to Java code by letting developers put it in more places.

3) And of course, Project Coin. The small useful changes to soothe away some of the common irritations with the langauge. The most likely handful have been picked (Strings in switch, improved exception handling, ARM blocks, improved type inference, Null safe operators, and simplified varargs), and there's another handful going through the mangle. Including some rather interesting ones for developers hoping to use JSR 292 to implement (better, faster...) a dynamic language on the JVM.

Some might be glad of that !

Tuesday Jul 14, 2009

JDK watch: Type Annotations (JSR 308)

Yesterday's weekly build of JDK 7 includes a big set of changes: more backporting of Java SE 6uX features, fixes to Nimbus, fixes to NIO2, and the like. But most notably, as planned in May, the incorporation of the other Java language addition for JDK 7: Type Annotations.

Java Annotations have been enormously successful since their introduction in J2SE 5.0, allowing a wide range of different kinds of information to be attached to source code. From signaling that tools make a variety of checks be made to your methods or classes, to the partial eradication of unwieldy deployment descriptors in Java EE (Aside: how the world turns ! The Planetarium Janitor remembers the very earliest pre-release days of in the corridors of Java EE, when deployment descriptors were property files).

In Java SE 6, JSR 269 introduced 'Pluggable Annotations' with an API for tools to be able to manipulate custom annotations of their own design.

And now, JDK 7 will allow Java Annotations to go where no Java Annotation has gone before. Read all about the project here.

Monday Jul 13, 2009

JavaFX Coding Challenge Winners

You don't need to wait for the Java App Store to open its doors layer this summer to see what kind of commercial applications you can use JavaFX to create. Just take a look at the winners of the JavaFX coding challenge.

In first place, Sten Anderson's Music Explorer FX uses the Echo Nest service to power a beautiful, engaging fullscreen application that pulls images, videos, plays music, shows news and reviews, similar artists, and keeps a history or your musical exploration.
Next is Naoaki Suganuma's LifeScope: hooking up to a server hosted on Google's App Engine, this application pulls data from your blog, examines EXIF data from your photo library and the friends Gmail address book to chain together an interactive view of the events and friends so catalogued.
And in third place, Evgeni Sergeev's ShiningEtherFX is an image creation tool specially for making background images for web pages or RIA applications by compositing layers of images created from a color scheme, path curve and profile.

And there were student winners too. Check them out.

Friday Jul 10, 2009

Scala Lifting Off ?

If you are think about adding a new language to your programming language history, then you are probably following the recent discussions about whether Scala will replace the Java language, summarized here at InfoQ and with a followup from James 'Groovy' Strachan here.

Scala is an object oriented and functional language, like many other JVM languages. Yet unlike many of today's JVM langauges is statically typed. It's been implemented on other platforms (.NET, Android) but still primarily appears to be used on the Java SE 6 VMs. It's been through a couple iterations since its first release in late 2003, and although typically Scala programs use the underlying Java APIs, frameworks are starting to appear for Scala, most notably, Lift, for web app development.

And NetBeans seems to be ahead of the curve in its support for Scala.

A nice way to see if you agree it could replace Java one day.

Thursday Jul 09, 2009

Best-kept secret in the JDK ?

If you don't have the remotest idea what it is, you should check out this paen to the VisualVM.

Wednesday Jul 08, 2009

Jazoon 2009

While JavaOne is pretty much the focal point for announcing stuff, and is really a consistently well attended conference, for those of you in Europe, two conferences: Devoxx (nee Javapolis) and the 3 year old Jazoon are  becoming must attend events.

James Gosling opened the recent Jazoon conference, and proceeded to meet many of the 1100 attendees. Your humble Janitor also gave a keynote the next morning (slides), attempting to continue a long tradition of reducing the world into pithy top 10 lists: this time covering JDK 7 and JavaFX 1.2.

As usual, there was an immense variety of talks. Most all of which you can get the slides for here.

Tuesday Jul 07, 2009

Playing JavaCards

With this week's news that the UK London police force will deploy 80,000 smart cards with JavaCard for its building and system access, its good to see that there's a great new way to start working with the technology:

The PlaySIM project is an open source software and hardware project that is truly a playground for a variety of scenarios for JavaCard. A JavaCard is nothing without the environment to which it connects, whether that be through a magnetic reader, near field communication bridge, or if you remember the people counting sensors deployed at JavaOne 2008, in a SunSPOT.

See an in-depth talk about PlaySIM here.

Monday Jul 06, 2009

JavaFX on Swing, Swing in JavaFX

To a large degree JavaFX is designed with a new generation of developers in mind, those with a little more art than science in their backgrounds. More into shifting shapes on screen than polymorphism in code. And they may well be wearing skinny jeans for the first time, unlike the Janitor who was pioneering them in the 1980s.

But for Swing developers who have art and science in equal measure, JavaFX is a great companion to add to the portfolio.

Original team member Amy Fowler blogged recently about how to use JavaFX to make over an existing Swing application.

And with the latest release of the JFXtras, a handy suite of goodies for JavaFX development, comes the new JavaFX wrapper for Swing components, as you can read all about here.

Thursday Jul 02, 2009

Sampling JavaFX 1.2

One of the best ways to chart the progress of JavaFX these days is simply to go and look at the samples.

The new set of UI controls and layout managers in JavaFX 1.2 are pretty nifty. So its easy now with these new additions to the scenegraph to go from gamesy style (like Brick Breaker, or Pac-Man) to plain fun, like the flickr photo viewer, through drawing centric apps all the way to the more traditional interface, like this project manager, or any hybrid inbetween. With its own skin in CSS.

Getting data into a JavaFX application is easier too: you can easily fetch the data in a background task, as seen in this simple Twitter client, or get it from an RSS or ATOM feed, and no matter where you are (Desktop (Windows, Mac, OpenSolaris or Linux), mobile or TV) you have application data stick around locally between sessions.

And with the new RTSP support for media, smaller application binaries and runtime optimisations, you should notice a jump in speed also.

Wednesday Jul 01, 2009

Garbage First 'quite zippy'

You've probably been told over the years how great JVMs are. How well they've scaled, perform under a variety of different loads. How its doing its part to take advantage of the processing power of multi-core systems now that cranking the clock rate is almost wrung dry.

The automatic memory management provided by the JVM's garbage collector is one of the most important aspects of scaling the JVM. There are many different kinds - as this great primer shows.

The new (free) Hotspot Garbage First collector in beta form for evaluation in Java SE 6u14, and which will ship production quality in JDK 7 is summarized succinctly here, and you can find a more detail here about this generational, compacting, mostly parallel collector that offers a much smoother ride that the CMS collector will replace.

And some early signs of use are encouraging !

Tuesday Jun 30, 2009

JavaFX: gr8 2 c on fonz

What with the release of JavaFX 1.2 and JavaFX phones on sale to developers, and on view, for example here and here, the fact that the JavaFX language and common APIs are the same whether you are on the desktop or on a mobile device (or a TV set top box) is worth chatting about.

Of course, there are design considerations when creating applications for the smaller screen. And you need to take some care over input methods (keys, mouse, touchscreen). And of course there are times when you want to write an application that uses a feature that is totally specific to the underlying client device.

Like SMS on a mobile phone. So reading this article should give you a really clear picture of how to take advantage of the underlying messaging capabilities on a Java ME phone, and combine it with the fit and finish of a JavaFX UI layer to make a professional SMS client, with all the visual cues and polish that are both desirable and required now in a phone application. And along the way, put together an on screen keyboard with the minimum of fuss.

Monday Jun 29, 2009

Java ME Defragmentation

For those of you concerned about Java ME fragmentation, you were probably pleased about the creation of JATAF - a group of mobile companies (and Sun) getting together to try to sort out the issues of differences in implementation, quality, and performance that even the best API specs can't always iron out.

Such organizations often flirt with an excess of hot air, but happily, this organization is taking a practical approach - by basing their efforts around collecting up a big set of tests that plug into a test framework that originated in a Sun testing product called JDTS for mobile devices that can run its 12,000 or so tests on Java ME mobile devices and that's been around for quite some time. Such tests assume API compatibility, which is what the JCP requires, taking testing to a deeper level by probing the other implementation qualities such as reliability and performance.

One step that made this possible was the open sourcing of the test framework, the Java Device Testing Framework from the Sun product. So now folks can sign up to JATAF and submit tests into the framework for all to use. There's over 70 already. You can read more at Terrence's blog, or listen in to the latest Java Mobility Podcast.

Wednesday Jun 17, 2009

JDK 7: Collecting Honey

There's also been a flurry of blogging and articles around the JDK 7 Preview, released at JavaOne, too.

Like about Project Jigsaw, which will modularize the JDK. Most of the audience got it when Mark announced that Classpath is Dead, but for a deeper dive, check out this JavaPosse episode, where both Mark and Alex got a grilling.

Or about the multi-language VM work, which John presented. And Charlie has used already in an experimental version of JRuby. And bytecode manipulation framework ASM has already picked up. Who's next ?

Project Coin, which is gathering a small set of additions to the Java language for JDK 7 is narrowing down the many options, as you can see from Joe's slides.

Take a look at this detailed article about NIO2, also in the JDK 7 Preview, and which Alan presented on.

And thankfully the is-the-G1-collector-free-or-not storm in a teacup blew itself out.

A blog all about Java in all its flavors on all client platforms from smartcards to desktops and everything inbetween.


« April 2014