06.16
If you have a Nokia S60 5th edition phone with an accelerometer then you can easily create widgets that read the device data. Why would you want to know how your phone is oriented in 3d space? I can think of a few pretty cool user experience reasons such as tilt-to-scroll (ala Instapaper’s iPhone app) and as the control mechanism for games. Unfairly though, widgets are not especially geared towards performance so gaming may be out of the question. In fact if you run my demo you will realise just how badly a JavaScript and HTML widget can perform – if you want nice animation in a widget you will be forced to use Flash lite.
In my rather simplistic demo I have a small block on screen that slides around depending on which way the phone is tilted. There is a bug though – a very big bug on my 5800 with v20 software: it eventually slows down and then crashes with a memory full error. You see there is a memory leak somewhere and, after rewriting my code many times, I have to assume it is in the phone’s handling of the sensor data interface for widgets.
Perhaps if you try out my demo you would let me know if it works for a prolonged period of time (>10 minutes) or not on your phone either by commenting here or via twitter (@perelson). Oh, and I know I said S60 5th edition, but if your version of S60 runs WRT widgets and has an accelerometer then it may just work for you as well.
Download the demo: blockmover.wgz. It installs as “Sensor BlockMover” in the Applications folder on your phone.
Warning: If this demo causes a memory full error, your phone may just stop some of the running programs. All I’m saying is don’t blame me if another application gets closed and you lose something important.