Moving to Android (mobile)

I’ve been using SonyEricsson mobile phones ever since the launch of the P800 some years ago – all with the Symbian OS. Until a few days ago that is. Now I’m on Android. I’m still in the process of finding my way around Android, but I’ll try to post some of the tips and tricks of running Android here. This first post covers the very basics.

The Phone

My Android phone is the HTC Hero. It seems well build and solid – and the case seem to be crammed full with just about any imaginable feature available in a mobile phone. The only exception seems to be an FM radio, but frankly I doubt I’ll miss it much. I didn’t really use it on my most recent P1i.

Filling a select drop-down with ajax data using jQuery

In user interfaces, it’s sometimes the case, that you need to have dropdowns with content dynamically loaded from a database, and sure you can query the database and place the content in the HTML-source as regular markup, but you can also write a few lines of jQuery powered javascript, and provide the data from an ajax-source.

Here’s how to do it.

First make the drop-down and as the single option make a “loading” message - just to let the user know something is happening.

Browser handling of broken includes in an Ajax world?

In this mordern web 2.0 age, javascript includes are used more and more - and in some cases solutions often depend on included content from 3rd parties. While it is nice these 3rd parties may provide us with data (such as the latest tweets from twitter), it would be quite nice, if issues on their server didn’t break the fancy page we’re building.

So the question is this: If you build a page and include javascript from foreign scripts, will error messages on their part break your site? We’ve made the assumption, that the Web2.0 page will degrade gracefully, so that the content/functionality of the javascript-includes is just extra frosting, not needed to use the page

Building image tags with jquery

Like tables, jQuery also allows you to play around with all other tags. In a recent project, we wanted to change a fixed set of labels/texts into icons instead. For this challenge jQuery was used to build the new image tag, and for good measure, here is a small example of how you can build an image tag - including alt-text and click-event.

The basic code for building and inserting an image into the DOM looks like this:

jQuery and tables

I’ve been playing with jQuery the recent weeks, and while it is reasonable simple to get started with and the jQuery documentation is pretty good, I thought I’d share a few snippets of jquery examples/code, which showcases a few simple practical uses for jquery.

First up - tables and jquery.

With jQuery you can add content to a HTML table. Here are to simple examples on how to add content into a table.

Flight Control

flight-control

I really like simple games, which you can play where ever you are - and which still has enough challenges to be interesting for quite a while. One of the best games I’ve played for a long time is Flight Control for the iPhone/iPod Touch. The game was developed by Firemint.

It’s a fairly simple game. You’re in control of an Airport and all you have to do is make sure the planes land at the runways. To do this you simply draw their designated paths on the screen. There are 4 different aircrafts - helicopters, propeller planes, small jets and large jets. As you play more planes concurrently enters the airspace - and eventually it gets quite busy and avoiding mid-air collisions a challenge.

Better but Broken

Working with application development - either on the web, on the desktop or any other place - is often quite interesting. When making new releases features are added, changed - or in rare cases removed.

As a developer - or “software product manager” - it must be an interesting challenge to keep up with the users and the market to capture the features and changes to a product, which will make it better from release to release.

Ubunutu Uncomplicated Firewall

I’m still enjoying the fresh new Ubunutu 9.04, and one of the nice new features is a firewall – which Canonical calls “Uncomplicated Firewall”. I’m usually not hooked on firewalls, but just for the fun of it I enabled the firewall on my laptop and it seems to work quite well. The firewall doesn’t seem to have any noticeable impact on system performance and as the laptop from time to time visits open wifi’s, it’s probably a good idea to have protection from other users on open networks.

Ctrix and Ubuntu 9.04

I’ve recently wiped the hard drive of my laptop and upgraded to Ubuntu 9.04. The Linux desktop is a perfect place to do development and surf the net, but the corporate network is a Windows world and to access mail and other enterprise applications we use Citrix servers. Getting Citrix running on the new Ubuntu is easier than ever.

sudo apt-get install libmotif3
sudo ln -s /usr/lib/libXm.so.3.0.2 /usr/lib/libXm.so.4

download the most recent client from Citrix.

Welcome to the "new" old site

Let’s call it lift off… This site has been online in some form or another for 10+ years. During that time I’ve been runing a static HTML site (eventually with a few CGI’s), later on Movable Type a few years and most recently an odd mixture of Wordpress, Gallery2 and custom code. During the past months I’ve been trying to make things somewhat simpler, and what you’re looking at right now, is the first step - a new look (though a standard Wordpress theme and a drastically reduced plugin collection).