Lately I’ve been playing around with my old Sony Clie SJ30 which runs Palm OS 4.1. I managed to tether it to an equally old Motorola i50sx iDEN mobile phone and soon I was browsing the web on the “big” 320×320 px screen during my commute on the train. That was pretty cool. I tried a bunch of different Palm browsers from the ancient (but free) text only Palmscape and Eudora Web to several commercial browsers, the best of which seems to be Xiino 3.4.E.
I was initially quite pleased. Pages actually seemed to load faster in the Palm browsers than with the phone’s own built in browser. Reading long pages was also a breeze as the larger screen meant much less scrolling. Xiino resizes images and does a great job of reformatting full size web pages to fit the PDA screen.
Soon I discovered a major annoyance, all the Palm browsers, even Xiino, were stuck in an HTML 3.1 time warp. They ignored CSS formating and all but Eudora refused to load WAP2 pages sent with mime type “application/xhtml+xml”. But the worst thing about the Palm OS browsers was that they turned utf-8 unicode characters like left and right quotes into an ugly sequence of three characters so – “smartquotes” – became – “smartquotes“ – and – Google’s latest acquisition – became – Google”™s latest acquisition – argh. That wouldn’t have bothered me if it was a rare occurrence. But a lot of the blogs I read were just loaded with these garbage characters. It turns out that WordPress defaults to replacing regular single or double quotes with “smartquotes” which are left and right single and double quotes. Also, if you type two or three dashes in a row WordPress replaces them with the longer single dashes, en dash and em dash in typographic terms. The smartquotes and fancy dashes look great in a modern browser. Unfortunately, they are represented by either double-byte unicode literal characters or some of the newer html entities – neither of which Xiino or any of the other Palm OS 4.1 browsers can display properly. The entities look a little better – showing up as a blank or a little box where the character should be. The literals were what produced the three character mess shown above. I turned off smartquotes etc. on this blog which required installing the TextControl plugin as I want to support all browsers not just modern desktop ones. Of course that didn’t help me when reading other people’s WordPress blogs.
So I though, what about Opera Mini? It’s a throughly modern browser in Java ME. I wonder if it will run in the free Java ME runtime for Palm OS from Sun. Well it doesn’t. At first I couldn’t even get Sun’s Converter tool to create a Palm format .prc from the Opera Mini .jar and .jad A little Googling took me to this thread on Opera’s Mini Forum where I learned that this is due to a bug in Sun’s converter having to do with the order of the files in the jar. If the manifest file (a text file of meta data inside the .jar) happens to be the last file in the jar the Sun converter fails. So I rebuilt the .jar using winzip (a .jar file is just a .zip file with a different extension) adding the manifest to the zip first and then the other files while being careful to maintain the same directory structure within the .zip/.jar. Finally, I was able to create a .prc with the Sun Converter. But the .prc doesn’t work in the Sun runtime on the Clie – it opens for a few milliseconds and then immediately closes. As the converter doesn’t have any switches or options to set and I don’t have the Opera Mini source file or the skills to modify a Java ME app, I concluded that I had reached a dead end with the Sun VM.
More Googling and I found that IBM used to sell a version (5.6) of their Websphere Studio Device Developer (WSDD for short) which included the J9 Java ME virtual machine for Palm OS 3.5 – 4.1. IBM briefly offered the Palm runtime to end users for $6.00 and also created a version for Palm Inc. which was crippled so it would only run on the Tungsten W. There no longer seems to be any way to buy the 5.6 runtime, only the latest 5.7 version which only works with OS 5. The only way to get the J9 runtime for Palm OS 3.5-4.1 anymore is to download a free evaluation copy of the complete WSDD 5.6 development toolkit.
WSDD has a command line tool (jxe2prc) for converting a set of .jad and .jar files to a .prc. I built a .prc using jxe2prc with the default settings and loaded it on my Clie. The Opera Mini splash screen came up and then came the reset. And reset and reset. The PDA was stuck in a reset loop and I had to hard reset to recover. I had just hotsynced so I didn’t lose anything – another hotsynch and I was back in business. WSDD’s jxe2prc tool has many options and very little documentation of what they do. I grabbed a copy of the Palm W emulator off the Palm site and started trying various combinations of options.
After many tries and as many hard resets on the emulator I found a combination that that creates a .prc that works on the emulator without reseting. It actually works pretty well – on the emulator (top image). The only bad part is that it takes about 40 seconds for Opera Mini to start up. If you’ve used Palm devices you know that most apps load almost instantly. For anything on a Palm to have a 40 second startup time is unheard of. The J9/Opera Mini combination is also un-Palm-like in that it doesn’t retain it’s state when you switch to another Palm app or turn the PDA off. Native Palm applications are supposed to always startup in the state you last left them in. This is really cool, in that it gives the Palm the appearance of multi-tasking without actually having the hardware, horsepower and OS needed to effectively multitask. Using Xiino I can copy a snippet of text off a web page, switch to Notepad, paste the text into a note and switch back to Xiino with no delay and still be on the same web page without missing a beat. With Opera Mini, I can’t do this. Not only is copy and paste from Opera Mini’s window disabled but if I switch to Notepad or any other app and then switch back to Mini I have that 40 second wait and then I’m back at Mini’s start screen rather than the page I was on when I left.
At least it runs reliably once Mini finally loads. The menus are quite responsive and pages load about as fast as in Xiino and look much better with no garbage and CSS colors, borders and formatting applied.
Unfortunately things aren’t so rosy on the Clie. The J9 VM doesn’t seem really support the Sony’s non-standard hardware and modified version of the Palm OS. There are both display issues and instability. The display looks bad because the background behind text is a different color than the rest of the background and if a link has focus instead of being displayed in reverse video, only the background color is reversed so I get blue text on a blue background – very unreadable. You can see how Mini looks running on the Clie in the bottom image. Their are two stability issues. If I tap the screen or press any of the PDA’s buttons while a web page is loading the app, the Clie lock’s up and requires a soft reset to recover. Also, if I exit Mini or switch to another app after browsing for more than a few minutes, the Clie soft resets with the error “DataMgr.c Line:6317 Invalid uniqueID passed.” So I can only browse the web with Opera Mini if I’m are very careful to wait for a page to fully load before trying to scroll or follow another link and am willing to put up with a soft reset every time I quit Opera Mini. I blame these issues on J9 rather than Mini as even the most vanilla of JavaMe games exhibit the same display problems and other network aware Java ME apps will lock up when if I tap the screen or press a button while the app is talking to the network.
The fact that none of these problems, other than the slow initial load times occur on the emulator gives me hope that Opera Mini can possibly be run reliably on at least some pre Palm OS 5.0 devices. I’ve pretty much given up on trying to run Mini on my Clie but I wanted to write up the process in case any readers want to try it on their own devices.
If you do try this – just be sure that you have hotsynced and backed everything up on your PDA first. Resets, including the dreaded hard reset and even data loss are a definite possibility.
Here are the steps to get Opera Mini running on your Palm OS 3.5 – 4.1 PDA:
Go to here and register as a developer, it’s free and instant (note: the URL doesn’t seem to work in Opera 8.5 (bad IBM). Firefox or IE do work). Once you’re registered go back to the above address and login, you will be able to download several versions of IBM WebSphere Studio Device Developer. (WSDD for short) Version 5.6 is the last one to support PalmOS 3.5-4.1 and that’s the one I’ve been playing with.
After you have downloaded and installed WSDD, download the Opera mini lofi jar and jad from here and copy them into WSDD’s ive-2.1\bin directory (C:\Program Files\IBM\DeviceDeveloper5.6\wsdd5.0\ive-2.1\bin if you’ve installed WSDD in the default location.
Then open a command prompt in the same directory. At the command prompt enter:
“C:\Program Files\IBM\DeviceDeveloper5.6\wsdd5.0\ive-2.1\bin\jxe2prc” OPRA
OperaMini -translate -compress -vmOption -Xss32k -vmOption -verify -stacksi
ze:14336 opera-mini-1.2.3214-basic-us.jad mini.prc
Type the command all on one line. The name of the Opera Mini .jad may change, replace “opera-mini-1.2.3214-basic-us.jad” with the actual .jad file name.
The above command should create mini.prc in the same directory. Hotsync mini.prc and the J9 runtime which consists of the files: j9_vm_bundle.prc, midp21.prc and j9pref.prc to your PDA. The runtime files can be found in C:\Program Files\IBM\DeviceDeveloper5.6\wsdd5.0\ive-2.1\runtimes\palmos\68k\ive\bin\ assuming you have installed WSDD to the default locations.
A word about the parameters:
-stacksize can be anywhere in the range from 8KB ( 8192) to 15KB (15360) – they all seem to work the same but too little -stacksize:4096 (4KB) gives a stack overflow error loading Mini and too much -stacksize:16384 (16KB) throws an out of memory error.
-verify which is completely undocumented seems does wonders for Opera Mini’s stability. Without -verify hard resets are common, with it I haven’t had any.
-Xss32k sets the stacksize (apparently a different stack than -stacksize) to 32k. You can try different values here, I haven’t really played with this one much.
You can change all the parameters except -stacksize at runtime in the J9 Preferences panel on the Palm device. That are about a dozen parameters in all. If you want to play around with modifying the parameters, I strongly recommend that you download the Palm OS emulator (POSE) from PalmSource (free registration required.) as you will be doing a lot of resets.
Send me a comment if you try this on your PDA, whether it works or not. I’ll update this post with your experience.