Since I posted last week about how I was experimenting with running Firefox on my Palm Pre a number of tech news sites, large and small, picked it up and posted their own take on it. Some of the sites (and some of the readers of those sites) made some fairly odd statements about my work. This is probably because to the uninitiated (and many of the initiated in fact) the internals of Firefox are something of a mystery. I also suspect I made a couple of poor choices of words which led to some misunderstandings so I’d like to try to clarify a couple of points that might make it easier to understand what is going on.
Why this isn’t a port of an Android application
Lots of sites made mention of how this is a port of Firefox for the Pre. This isn’t surprising since even I said that. Many also called it a port of the Android version of Firefox, this is slightly true but really a misnomer. What you have to realise is that the bulk of Firefox’s code is written to work on any platform, only a few fairly small parts of it are platform specific. For the most part this is called the widget code and handles drawing the UI on the screen and receiving mouse and keyboard events. There is a widget implementation for Windows, for Linux, for Mac, for the N900, for Android and would you believe also for BeOS and OS/2.
The largest part of the work of making Firefox run on the Pre was writing this widget implementation. It’s true some of it was copied from the Android widget code, but that is because that already had code to use OpenGL to draw to the screen. No point in trying to rewrite that from scratch when you’re going to do exactly the same thing anyway (especially if you are like me and have never touched OpenGL before). If it makes people feel any better though the Pre version is now using a 2D method of drawing to the screen which is totally written from scratch so hardly any of the copied Android code remains now.
Why user interfaces don’t always need to look nice
I should probably have expected it. Loads of places posted only the screenshot and not the background description to it, my fault really for not getting the blog post up in time. Even then I didn’t say a lot about why I was using the full Firefox UI either so of course lots of people complained about how terrible the UI was and it would never be any use and was this some sort of joke? The thing is that during that early work having nice looking UI is really unimportant, maybe even detrimental to getting things done. All that is important is that you can see enough to see that things are working. Because of this it makes more sense to use Firefox’s desktop UI for testing as it is complicated and uses many different types of UI elements. If anything wasn’t working properly it would be obvious pretty quickly. In contrast the Firefox Mobile (commonly referred to by its codename Fennec) UI is simple and stays out of your way. Most of the time you can’t even see any of the UI, just the webpage. So you wouldn’t actually notice very quickly if a part of the UI was broken.
Once the code to run Firefox on the Pre was working switching between the full Firefox UI and the Fennec UI is actually pretty simple, basically just a different build configuration. Now that things are working I’m mostly testing with the simpler Fennec UI which hopefully looks more usable on the small screen. There may still be some work to do though, The Palm Pre has a smaller screen than I think any other device that the Firefox Mobile team develop for which means it is still perhaps too large to be useful. I’m looking at ways to solve that without having to fork the entire UI.
In the meantime here is a shot of what it looks like right now. This is a screenshot taken straight from the device.
Why the Palm PDK doesn’t suck
At least one site took my comments about problems debugging to mean that I didn’t think much of developing against Palm’s PDK, literally turning my statement that “Debugging is hell” into “Palm Pre coding is like hell”. This couldn’t be much further from the truth. For a mobile platform developing for the Pre seems remarkably easy. Granted this is the first mobile platform that I’ve ever developed for but the fact that it was basically a few hours before I had a command-line program compiled for and running on the phone seems like a testament for just how easy Palm have made this. Yes there are some teething problems with things missing from the PDK, but it is in beta, I’ve seen important bits missing from SDK’s released by Microsoft that are somewhere around their 7th version so in comparison Palm are doing great. And yes debugging is difficult, but debugging is difficult even on desktops. There has been really only one problem where I got completely stuck and had no way to try to figure it out myself, and in that case the Palm developer relations team stepped in and very quickly gave me the solution I needed.
Where are things now?
Since Palm helped me solve the main hanging problem a couple of days ago I’ve been working on resolving the main stumbling blocks to being able to really browse the web on the phone by fixing little things like making characters like “/” and “:” work from the keyboard. I’ve also added orientation detection so you can browse in portrait or landscape mode and fixed ctypes to work, it is this latter bit that will allow a future version of the Weave extension to work on the phone letting you sync bookmarks and history with your desktop. There are still a couple of bits that I’d really like to fix before letting people get their hands on this, like zoom and gesture support but I wouldn’t be surprised if I have those fixed very soon now.
I’m going to be at Palm’s developer day on Saturday if anyone wants to say hi, I’ll try to remember to load a working copy onto my phone to show off before I go.