If you've ever spent time in the Middle East, you'll know that bargaining is a way of life. You haggle over everything, especially if you're a tourist - they automatically triple and quadruple the price if you're a foreigner. So it doesn't seem that unusual to be arguing over the price of a bus fare to the center of Turkey - a reduction, when converted to sterling, works out to around 50 pence. So, in the flush of pride at finally having outwitted the locals and arguing the price down to an "acceptable" amount (which is still probably 2 quid more than the locals pay), you should not, on the face of it, be that surprised when the coach pulls up on the outskirts of some unknown city, depositing you, your backpack, and some equally bewildered Turks unceremoniously on the side of the road at 4 in the morning.
Looking back, I've come up with the perfect J2ME application for situations such as those - an instant travel guide: part phrase book, part translation guide, and part GPS-based map system. Ignore for a moment the small difficulties such as the fact that very few phones and even fewer PDAs (if any) have GPS facilities built in, and it does seem like an incredibly useful tool. At the time I'm sure I would've been quite happy to pay an extortionate U.S.$20 membership fee and three months' subscription in advance, just for the peace of mind of knowing exactly where on earth I was and a few useful phrases to converse in with my fellow travelers, also stranded on the roadside. Again, even before starting to travel, I might have been interested in a more reasonably priced subscription for three or four months, or perhaps a year.
I'm sure someone out there is going to argue that WAP is a likely enough candidate for this application; however, I'm equally sure that a Java version is a better idea. Designed well, it would present a slicker interface - relatively consistent, no matter what the platform. With a slightly heavier interface, the map rendering could be done on the client side, reducing the probable network traffic required.
What this example hopefully illustrates is that there are real-world applications in which J2ME just fits. Part 2 of the beginner's guide to MIDP, found in this issue, will demonstrate one such application, simplified greatly by the use of Java. You'll also find a review of one of the ever-growing number of devices that could run this sort of app: the Compaq iPAQ. For good luck, we also review one of an also-increasing number of J2ME virtual machines: Insignia's Jeode.
As expected, there were a number of important announcements at JavaOne covering a bewildering range of products and APIs. In some ways I'm glad I wasn't there, so Alan (our E-I-C) has to summarize it all for me. That's what I keep telling myself in those moments when my skin turns that delicate shade of green. Must be something to do with my diet.
A couple of the more surprising pieces of news: Sony announced the integration of Java into the PlayStation 2 console, and Sun proclaimed a new J2ME Games Profile. Java is definitely underrepresented in the console market with only Sega's ill-fated Dreamcast supporting a version of PersonalJava so far. At this point it seems likely that one will have an impact on the other, since Sony is involved in the Games Profile specification, but what it will mean for you and me, as developers, is not yet clear. Stay tuned.
By the way, while standing on the side of a Turkish road in the middle of the night, without a clue what to do, a cab will generally come hurtling out of nowhere, the driver pretending he hasn't seen you, and still somehow manage to stop right next to you by applying the brakes at the last possible instant. He will, of course, also speak English. It's one of those unfathomable, natural laws.
Jason Briggs works as a Java analyst programmer in London. He's been officially
developing in Java for three-and-a-half years - unofficially for over four.