Monthly Archives: October 2007
Headless Fedora tips
Being a computer nerd makes you write ridiculous things like “headless fedora”. If you look up those words in the dictionary, you would think I was talking about hats for people with no head. Anyway, it seems like a lot of system admin tasks on Fedora, if you look them up on google, refer to the graphical utilities included with it. Many times it is advantageous to forgo the use of the graphical stuff (like in a headless setup). Here are a few tips for how to do some things without the gui tools:
iPhone Tech Talk
This week, I had the opportunity to go to a talk at the University of Washington about developing apps for the iPhone. At the moment, development is restricted to web apps, but there is an SDK that is supposed to come out in February which should open up more development avenues. For now, we are restricted to web apps, so the talk was about that. As a side note, it is possible to develop apps natively, but it is completely unsupported by Apple.
The day after the talk, Apple released most of the presentation materials on their iPhone dev site, so you can check it out there as well. You have to sign up for an online ADC account, but that is free (although their “security questions” policy is highly obnoxious).
So, on to the meat of the presentations… The talk was basically broken down into three sections. First was a discussion of the capabilities of the iPhone web browser. Next they discussed data (mostly video) capabilities on the iPhone. Finally, they concluded with a session on designing good looking apps for the iPhone.
The web browser built into the iPhone is based on Safari 3, which is currently in beta on Windows/Mac, but it will be fully released along with Leopard tomorrow. Safari is based on WebKit, which has an open source version. Three levels of web support were defined: Compatibility, Optimization and iPhone apps. Basically, the first step to making your web site work with the iPhone is making sure the regular version works with Safari 3 and the limits of the iPhone. Optimization involves making your site work better with the I/O methods of the iPhone, and iPhone apps use specific Javascript/CSS features of the iPhone.
The first part, compatibility, basically gives tips on how to keep your CSS and Javascript compatible with standards, rather than just making sure they work with the mainstream browsers. They mentioned things like using Javascript object detection instead of user agent strings. Generally, if your site works with Safari 3, you will probably be in good shape.
The second part is optimization. There are various tricks you can use to make sure your web site looks good on the iPhone. For example, the iPhone pretends to be a 980×1091 display and then shrinks the web page, so you can test that on the desktop. There are also some custom CSS things that set whether or not your web site should be zoomable, or what CSS file to use based on the characteristics of the browser (like screen size). The CSS media queries are a standard CSS thing, so they will work in other browsers as well.
Finally, if you are going to try to make a web site specifically for the iPhone, they have some additional recommendations. You should make use of AJAX, so the app is responsive and interactive, and try to emulate the layouts and styles they use in native iPhone apps. One of the more interesting things they mentioned was the use of the Canvas object, which is built into most web browsers (excluding IE), and allows drawing custom things on the fly on the screen.
In the data presentation, the basic flow of data to and from the iPhone was described, most of which is pretty obvious. Things like calendar data flowing to the phone via iTunes were described. They also went into some depth about optimizing video for the iPhone. There are some encoding settings built into Quicktime for the iPhone in Wifi and EDGE modes. You can encode your video for the various data rates, and create a “Quicktime reference movie” which links to the various copies of the video. The iPhone will choose the proper video when it is directed to a reference movie on the web.
The design presentation went over some concepts of how to design your app to match up with the iPhone’s native apps. Most of it was pretty basic stuff. They did iterate one important point, which is to keep in mind the goal of facilitating what your user wants to achieve. Getting wrapped up in the details can lead to feature creep and make the flow of the application confusing. I thought this was a good design concept in general which applies to all applications.
All in all, the talk was an interesting overview of the dev environment available today, and gave some background into some of the “vibe” of the iPhone. There were a couple cool things to pick up on, but a lot of noise as well. While the current environment does provide the tools to achieve quite a bit, I look forward to what might come in the February release of the new iPhone SDK.
Blackberry dev gripes
I’ve been working on a project to port a GPS enabled MIDP app to the Blackberry 8800. This is the first Blackberry work I’ve done since the Nextel blackberry 7520 and 7100i’s. Things have changed a bit, but not that much. The dev environment works pretty well, but I do have a couple gripes. I think some of my issues have to do with not using the “JDE” they provide. RIM should really come to grips with the reality that people write apps for many MIDP devices, and it would rarely be practical to use a Blackberry specific IDE. Anyway, here’s my list at the moment:
- The 8800 randomly reboots sometimes when you use javaloader to install an app. I’ve heard that something similar happens on the 8820, but it prompts you before rebooting. This really slows down the turnaround on the compile-install-test cycle.
- The 4.2.1 JDE comes with a JDWP debugger, which apparently lets you do on-device debugging. I’ve gotten it to attach to a device via Eclipse, but it doesn’t stop on my breakpoints. It does output the System.out.println()s to the console though.
- Over the air provisioning is clunky on Blackberry. You have to provide a JAD (which you don’t for cable loading, so why is it needed here?), and you have to split the COD file into a bunch of little ones (which I guess explains the need for a JAD).
I think I have a few others, but I can’t remember them now. I’ll have to add them later…
Java is better than .NET
Back at Trimble, I wanted to write some unit tests for our DAO stuff, so I came up with this crazy scheme to run a test SQL server on the local machine. I had all this custom code set up to prep the database for the test, then run the tests.
In Java, I am using a HypersonicSQL (is it even called that anymore?) in-memory database to do testing. It’s really fast since it doesn’t write to disk, and every time you run the tests, you have a fresh database. You just inject the HSQL config into the HibernateUtil class and run the tests.