Developers of applications for mobile devices have traditionally faced a built-in limitation to the widespread deployment of their solutions, writes Terrence Barr in "Rich Applications for Billions of Devices: What's New in LWUIT?" According to Barr, the limitation results from the platform-specific nature of the graphical user interface (GUI) aspect of applications and its UI-related code, which typically makes up the bulk of the application. The answer, as he sees it is a well designed, highly portable, open source, and platform-independent UI toolkit with lightweight memory and resource requirements. LWUIT, in a word.
LWUIT, Barr explains, stands for Lightweight User Interface Toolkit, and is a UI library licensed under the GPLv2 open-source license together with the Classpath Exception, whose source code and binary are freely accessible for both personal and commercial use. Such a license encourages broad adoption and, at the same time, ensures transparency and compatibility at the library level, he notes.
First released in 2008, LWUIT 1.3 currently has many resources available to users, including a developer guide, articles, tutorials, code samples, videos, a site with featured LWUIT-based applications, and a very active developer community and associated forum, Barr writes.
Java developers using LWUIT no longer need to write device-specific code for various screen sizes, Barr points out, but can instead use the necessary UI components to provide the desired look and feel they wish their applications to display. It also allows those applications to work across a wide range of devices from various vendors.
Barr includes screen shots from the LWUIT demo as seen on three devices, the Java ME SDK 3.0 Mobile Emulator, a mid-range Sony Ericsson G705, and an HTC Diamond touch screen device to illustrate LWUIT's ability to operate across a range of devices.
Barr praises the capability of LWUIT that enables domain experts to work independently on their specific area of expertise because of the clean separation between the UI development, the graphics design, and the business logic in the solution.
The writer has a high regard for several other LWUIT benefits, including:
- Rapid development, which stems from its Swing-inspired API
- Portability: Built using low-level, common elements in MIDP 2.0, LWUIT has the ability to run across a variety of devices and different Java runtimes while maintaining a consistent look and feel.
- Flexibility: Developers who require a missing feature or component can create their own and plug it in.
- Easy Deployment: Simply by bundling the LWUIT library and resources with the application, developers can make the LWUIT components an integrated part of the application deployment unit that will be downloaded and deployed transparently when the user installs the application on his device (for example, via the standard MIDP OTA mechanism).
- Wide Range of Platforms: Barr writes that LWUIT requires only MIDP 2.0 and CLDC 1.1 (or similar basic graphics capabilities on other platforms) and is being successfully tested across a wide range of today's mass market devices.
Among the key features of LWUIT that Barr cites are:
- Rich Widgets
- Layouts Manager
- Pluggable Look and Feel & Themes
- Fonts, including both bitmap and user created fonts
- Touch Screen: All LWUIT components support touch events that require no special coding
- Animations & Transitions
- 3D and SVG Graphics integration
- Bi-directional text support support for right to left text
- Clean API, familiar to Swing developers
- Lightweight: Low memory footprint and processing requirements, adapts to platform
Barr observes that LWUIT also provides a Theme Creator tool for editing and creating themes and resources as a standalone application for creating and viewing background painting, objects, and other theme elements. It features as well a live preview of the application that changes whenever updates are made to the theme or screen properties, which he illustrates with a screen shot.
Yet another strong point in LWUIT's favor is that it is, according to Barr, the de facto standard for the creation of Java ME-based applications, offering a comprehensive development suite with a host of features that gives developers both a powerful and convenient environment and a set of tools to build and test applications efficiently. The LWUIT Demo application can be run and explored right from the main screen of the Java ME SDK 3.0, he notes.
Barr also lists the features to be found in LWUIT 1.3, which was released in December 2009. He takes a detailed look at certain ones of these, including:
- Table Component: Straightforward functionality that supports a large number of rows and columns, horizontal and vertical scrolling, in-place editing, etc. Barr includes application code that demonstrates a sample table.
- Lightweight Virtual Keyboard that can be bound to a text field will slide up when the user clicks or touches the text field to input characters. Both screen shots and code samples demonstrate this feature.
- HTML Component, which is not part of the official LWUIT 1.3 release but is now available as a pre-release in the LWUIT open-source repository, according to Barr. One can
display HTML content within an application without having to call an external content handler.
LWUIT Home Page
LWUIT on java.sun.com
Quick introduction to LWUIT
Read More ...