Choosing the right GUI library for JavaME

November 16th, 2009

I recently made a post about J2MEPolish, but have since made the decision not to use it and go with LWUIT instead. JavaME’s core UI support consists of the lcdui package and not much else; which is very basic and looks-wise not what your clients are going to expect in 2010. Which begs the decision of which 3rd party library to use. The choice has not been clear cut, and from what I can tell J2MEPolish was the best offering for a number of years. However when I started to use it, I found the build process it uses to lack the claimed compatibility with recent versions of both Eclipse and Netbeans. Furthermore, when making posts to Enough softwares forum, answers weren’t forthcoming and from what I can tell the project seems to be losing steam. Not a good starting point when using any technology.

Enter LWUIT, until recently the pet project of Shai Almog, a developer at Sun, this library has just made its status as an official Sun JavaME API. It’s approach of following the Swing model where practical, being code-centric and being supplied with a nice cross-platform Resource Manager for packaging fonts, styles and other files makes it immediately attractive and usable by any Desktop UI developer. I was happily coding right away and got further in half a day than I had in three with J2MEPolish. Its graphical effects look as thought they could be heavy for older phones, so if backwards compatibility is important to you this is worth consideration. For forward-looking proejcts on increasingly powerful modern devices, though, LWUIT offers a pleasing opportunity to make genuinely modern looking Java MIDlets.

Importantly, the project is in active development with version 1.3 due for release soon, supporting more Layout Managers and with fully implemented on-screen keyboard amongst other improvements. If you’re trying to choose a UI library for your next JavaME project, I would strongly recommend checking it out. You can start at Shai Almog’s blog, here: http://lwuit.blogspot.com/

After Effects Anti-Crash Failure

November 11th, 2009

I just had After Effects crash on me because of a problem rendering a frame. Yeah, It happens… The ‘last chance to save’ feature kicks in, allowing me to save my project. Phew, all’s well. But then, half way through the ‘last chance’ save After Effects decides it would be a nice idea to update the UI for me(?) which means re-rendering that frame, crashing again, reporting an inconsistency because its already saving the project (well, duh), and totally dieing. Adobe FAIL.

…and because I recently reinstalled After Effects, the normally brilliant 5-minute autosave feature that would have saved me from this much pain is, of course disabled by default. WHY? Idiots!!!

To top it all off I didn’t even want to render the frame I skipped to, I was just getting the playhead out the way.

I need coffee, this is going to be an extended working day :-(

J2ME Polish

October 25th, 2009

I’ve started using the J2ME Polish library in a JavaME project since using the default lcdui interface library isn’t a realistic choice for anything but the most sparse utility applications. J2ME Polish is more than a replacement UI library: it’s a build process which allows the developer a smooth upgrade path from their existing lcdui based code, beginning with the insertion of style directives which J2ME Polishes build process turns into additional java code just before javac get’s busy. The ability to make these directives conditional, and based on separate style sheets also eases deployment across different devices. Its a clever scheme, using Ant, but this does come at a cost; it is very fussy about its running environment and, unless you are already very experienced with Ant, some aspects of it can be bewildering. It’s clearly not plug-in-and-go software, so developers have a fairly steep learning curve before its power is unleashed. I’m going through my own trial-by-fire with it now; so here are some handy notes for anyone up against the same issues (including myself, later, when I forget :-) ):

Adding JAR Libraries: If your project references another JAR (one that isn’t part of the MIDP, CLDC or the J2MEPolish library) you’ll quickly discover that adding it to the project build path in Netbeans or Eclipse, in the normal way, is ignored by the J2ME Polish build process! Since the Ant build script controls the build process, it’s natural to look here next for an obvious ‘classpath’ entry, but theres no joy to be had here either. After much Googling, I found the answer is to add an attribute called binaryLibrary to the <build> element of the Ant script, in build.xml, like so:

<build
symbols=”ExampleSymbol, AnotherExample”
fullscreen=”menu”
usePolishGui=”true”
binaryLibrary=”/home/user/NetBeansProjects/exampleProject/kxml2-min-2.3.0.jar”
workDir=”${dir.work}”
>

Motorolas Poor Support for Java Developers

September 14th, 2009

If the following experience is anything to go by, MotoDev, Motorolas Developer site, must be full of inaccurate information. I recently purchased a v500 phone from eBay because MotoDev says it supports still image capture (JSR135) via Java. After much time wasted, I find that it does not. I then purchased a v80 because this site says it Bluetooth access (JSR82) from Java… more time wasted to find out that no, it doesn’t! These may be old handsets, but I would still be wary of buying Motorola phone in future if they can’t get these fundamental details right. £50 and 2 days of coding and headscratching down the drain :-( Thanks Motorola.

Developing a Robot

August 24th, 2009

The aim of developing this robot is to learn more about low level electronics and practice low-level software engineering, and just to have fun. The technical goal is to have the robot autonomously explore a room and map it out via use of its sensors. Then, after a ‘cold start’ in an unknown position in the room it should be able to locate itself as quicky as possible by identifying the nearest unique features. Much of this challenge comes later at the software stage. For now I am assembling the motor and drive electronics, as well as the ultrasound sensor based radar, IR reflectance sensors and wheel encoder and connecting these to an AVR microprocessor. This microprocessor will present the sensors and actuators to the host PC via an uplink provided by a bluetooth enabled mobile phone.

You can see some images, which I’ll be adding to, here: http://chrishatton.homeip.net/gallery2/main.php?g2_itemId=3093

Retrofitting a Compaq n610c with an SSD Drive

March 30th, 2009

Retrofit 1. To provide (a jet, automobile, computer, or factory, for example) with parts, devices, or equipment not in existence or available at the time of original manufacture.

I have just finished replacing the mechanical hard disc in my Compaq Evo n610c laptop with a Mtron Mobi 3000 SSD drive. Having used it for just a few hours, I can safely say it was worth it – the increase in responsiveness under Ubuntu Linux is immediately obvious from first boot.

Here is a brief account of the upgrade for the benefit of anyone thinking of doing the same: particularly owners of the Compaq n610 – or laptops of a similar era – which can be given a whole new lease of performance despite being products that are firmly into their middle age…

Never one to make it easy on myself, I bought a 1.8″ ZIF size drive, instead of the standard 2.5″ IDE that the Compaq takes (I was able to find it a fair bit cheaper on eBay). While I realised this woud require a little modification to fit the drive caddy, I han’t anticipated that because of the Compaqs very flimsy caddy design, I would be physically unable to apply the pressure needed to connect the IDE socket deep inside the machine, without there being a full size drive in it.

One bent & twisted caddy later, I downloaded the Compaq Service manual to get straight to the heart of the matter. I would recommend anyone opening their laptop to search for a service manual first; opening a laptop isn’t nearly as obvious and predictable as a desktop machine; they are dense, layered affairs, with clips and screws that need to be removed and replaced in a precise order to avoid snapping or stressing some as yet unrevealed structure. I can’t speak for other manufacturers, but it is to Compaqs credit that they make these manual publicly available.

So, here we go… full access to the hard drive bay required complete disassembly of the laptop, even the screen.

n610_SSD_1

With bay now open, the ZIF drive was put in position. I constructed a crude but effective cradle from slot-together cardboard pieces, there are 3 cardboard ‘ribs’ running under the drive and it is held quite securely in position. The small PCB which I am holding is a ZIF to IDE adapter, to which I have also attached the proprietary socket part of the original caddy. Be careful when attaching a ZIF ribbon cable: the design of the ZIF slots appears to have pins which contact the cable both top and bottom, where in fact only one side is the correct, active orientation. Refer to any guides at hand if you are doing this as one mistake here could cause electrical damage and cost you that lovely new expensive SSD.

n610_SSD_2

The next image shows the underside of the motherboard, held over the bottom half of the laptop case. Only in this position could the ZIF/IDE adapter board be attached to the proprietary hard drive connector on the motherboard. The adapter board is very light and is sufficiently held on by this connector alone.

n610_SSD_3

The motherboard is lowered into position; some last-centimeter-gap poking with a biro is required to persuade the fairly taut ZIF ribbon to flex into the space behind the drive, rather than be fatally crushed between it and the motherboard.

n610_SSD_4

With the motherboard secured back over the bay, the still dismembered laptop is powered up to ensure the drive is compatible, and has a proper electrical connection, before the slightly lengthy process of reassembling the machine. Note the installation of Ubuntu in progress :-)

n610_SSD_5

Performance and other notes to be amended…

Tree2D Applet Online

February 23rd, 2009

Here is a Java pet project I’ve been working on, partly out of an interest in procedural graphics but mainly just for some good old Java practice and to make the train journeys go a bit faster:

Tree2DApplet

Theres still a number of glaring bugs in the UI code, which I’ll be fixing, but its ready for an idle play. Random feature requests welcome!

The Applet will prompt you to confirm a security certificate since it allows saving of images and vector files to your local hard drive.

First iPhone App on the AppStore

January 29th, 2009

My first iPhone App, on behalf of Pocket PT, has now been released for sale on the AppStore. Essentially a bundle of videos, with text description pages plus a page updated from the web, it is simple enough by coding standards – but an important maiden journey through Apples not-so-straightforward submission process, paving the way for more advanced apps. Here’s a link to the iTunes product page: Swiss Ball Exercises with Pocket PT

I have joined Pocket Innovation

November 10th, 2008

Having spent over 4 years in the DVD authoring business, and pretty much explored all the technical possibilities the platform has to offer, I have decided to leave Metropolis and join a new technology company. Pocket Innovation are developing Pocket PT as the next generation in health and fitness sales and service – providing a three tiered online Personal Training solution: direct to customers, for Personal Trainers to manage their clients, and also a back end designed to enable gyms and health clubs to manage and retain members effectively. I am working with web technologies to develop and ‘white label’ our current site at www.pocketpt.co.uk. I am also responsible for developing opportunities for our brand in the mobile arena, with plans to develop a range of supporting iPhone and Mobile Java apps to accompany the site.

AfterFX Text Search and Replace script released

June 20th, 2008

One of those staple tools that comes in handy time and again, the whole project search and replace. This script works through all text layers in all comps of your AE project. I have been using this to speed up reversioning of text and graphic screens for different languages.

Download from the scripts page.