Posts

Showing posts from 2009

Fun with the iGala picture frame

Image
NOTE: This is an old article that I never got around to finishing. So it might or might not still be relevant. Turns out iGala is about to launch Android support for the frame, but until then, I suspect the following could still be of interest to some.

One of the most geeky of shopping sites must be thinkgeek.com. They have many wonderful and useless items to appeal to the geek inside of you, hell even my wife had a blast reading their catalog. Anyway, one of the items they sell (exclusively apparently) is the iGala digital picture frame, from Aequitas Technologies. Now I've come across countless of these, but the iGala is one of the few ones running an easy-to-access embedded Linux. In the following I will show what I mean and provide some documentation that I have collected.


Probing the frame from outside
It's an 8" LCD, capable of a 800x600 resolution and with a resistive touch membrane in front. Apart from that, not much info is given to the consumer - in spite of this…

Android debug bridge on ubuntu 9.10

It turns out the latest Ubuntu release makes it a bit more difficult to connect the multi purpose Android debug bridge to your Android device. The following is really just an update of my older entry, to remind myself of the changes in Ubuntu 9.10. This stuff is pieced together from various other sources online (mostly android-discuss) and thus not particularly original.

Ok so first of all, there are quite a few more vendors and devices now (yay). In order to identify your device, make sure your device is not connected and then execute the Linux command lsusb.


casper@workstation:~$ lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 07cc:0501 Carry Computer Eng., Co., Ltd Mass Storage
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus…

Tweaking javac leniency

While a great fan of type-safety and static checking, I also like a certain amount of leniency from compilers. Sun's Java compiler is a good example of one that goes overboard in some anal, misunderstood attempt at servicing the developer.
In the following I will explain why I think so and how to fix it by modifying the publicly available source code for the compiler. Note that although I have done something similar before, I am no compiler expert and never will be. The modifications shown in this post are mere tweaks and I will stay far away from anything below semantic analysis.


"Exception is never thrown"

Have you ever had a good coding session, with design, implementation and refactoring happening at an immense speed as you try to perfect the internals of a piece of code? All of a sudden you are distracted because a try block no longer contains any methods that declares a checked exception. So now, in order to satisfy the compiler, you'll have to focus on removing …

Android book roundup

Image
While it may no longer be so much for reference purposes as in the past, I still really like to have good books at my disposal as a software developer. The DPI of a book still beats that of any screen and I can bring a book to the restroom without raising eyebrows from my girlfriend. In the following I will come with a brief but hopefully useful review of the 3 Android books I have in my library.

O'Reilly's Android Application Development
The book covers Android 1.1 stuff and is thus already a little dated. The content and organization is a odd and lackluster I find, for instance there's a chapter on signing and publishing your application which comes before chapters on basic views and widgets. It also doesn't come with an ebook/PDF so there's really not a whole lot going for this book, you are probably better of looking elsewhere.





Manning's Unlocking Android
Also covers 1.1 stuff, but better content and definitely better organized than the O'Reilly book. It co…

DDMS on Ubuntu 64bit

Image
The Android SDK comes with a pretty nice suite of tools, one of these is the Dalvik Debug Monitor Service (DDMS). However, it seems like the Android SDK is distributed with some 32bit SWT libraries so if you are on a 64bit Linux, running a 64bit Java default, you might run into this little message:


casper@workstation:/$ dbms
43:27 E/ddms: shutting down due to uncaught exception
43:27 E/ddms: java.lang.UnsatisfiedLinkError: /android-sdk-linux_x86-1.5_r2/tools/lib/libswt-pi-gtk-3236.so: /android-sdk-linux_x86-1.5_r2/tools/lib/libswt-pi-gtk-3236.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1687)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
...


This is fairly easy …

Firefox 3.5 on Ubuntu 9.04

Well today the much anticipated speedy Firefox 3.5 arrived. Ubuntu probably won't push this one out as an update and I am not sure when Firefox's own auto-update would provide this upgrade, so if you're impatient as I, this is how to install it manually. Do read the whole thing through before deciding whether to do this, as there are some potential plugin issues involved!

Installation procedure
First you need to download and extract in an appropriate place. I'm extracting to /opt/firefox-3.5 such as to avoid collisions later when an official Ubuntu version is available:


casper@workstation/$ cd /opt/
casper@workstation/opt/$ sudo wget http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.5/linux-i686/en-US/firefox-3.5.tar.bz2
casper@workstation/opt/$ sudo tar -xjf firefox-3.5.tar.bz2
casper@workstation/opt/$ sudo mv firefox firefox-3.5
casper@workstation/opt/$ sudo rm firefox-3.5.tar.bz2 -f


Perhaps you notice that the download is a i686/32bit Linux release, this is bec…

Android Debug Bridge on Ubuntu 9.04

To perform general debugging and install alternative ROM's on the HTC Magic in Ubuntu 9.04, you will need a little more footwork than the documentation mentions.

First, I assume you have installed the SDK and added it to path so that you can perform ADB commands from everywhere. Then, you need to have USB debugging enabled on the phone, do this by going under Settings > Applications > Development and check the "USB Debugging" item.

Now, add a udev rule for your device:


gksudo gedit /etc/udev/rules.d/51.android.rules


Add the following to the file and save it:


SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"


Reload USB devices by issuing the command:

sudo /etc/init.d/udev reload


Unplug and plug the device. Check if you can see the device:

casper@workstation:~$ adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT95PKF00221 device


There, now you can browse your phone with the adb shell co…

HTC Magic Android emulator skin

Image
So I started playing with Android development, just received "Unlocking Android" and "Android Application Development" from Amazon. However before getting to do any real development, I got sidetracked in trying to create a skin for the Android Emulator that matches my new fancy HTC Magic. There actually exists one, but it's branded Vodafone, looks silvery and has the buttons all wrong so I decided this would be a good way to brush up on some Gimp skills. And here it is, I am no graphics artist so I am moderately pleased.



You may use images and skin as you please, under the creative commons license. You can download the skin by clicking here. To install, simply extract the files to {android_install_dir}/platforms/android-1.5/skins/HTCMagic/.

If you can not select the skin in Eclipse, you may have to edit the config.ini file of your virtual android device setting manually (under ~/.android/avd/), simply set the skin.path property to point to HTCMagic. You can also …

Android awesomeness

Image
So I finally got an Android device, in the form of the second generation hardware from HTC known as the Magic, G2, Ion and Saphire. Since the original HTC Dream (G1) this phone received a major visual overhaul and now boosts a soft keyboard rather than a physical one making it a loss less clunky. And let me admit right away, I fell in love at once and have hardly put it down since. It is not my intention here to write any kind of throughough or balanced review, but merely to showcase Android and the applications to others contemplating getting one of these phones as well.

Initial impression
The phone looks and feels sturdy and quality, thankfully not branded like appears to be the case in the US. The 3.2" touch screen is glass just like the iPhone and the body is thick scratch-proof plastic. It has what amounts to 11 buttons (incl. a joypad) below the screen such as well as volume buttons on the side.
Having played with an iPhone a few times, my impression is that the Magic is very …

Maven: Compile to a RAM-drive

While preparing to do a backup recently, I realized that I had over 2GB in 110.000 files which was the result of either an Ant build or Maven target. It occured to me that with Maven especially, this is nothing more than garbage to keep around, since Maven will copy the artefacts to its /.m2 folder anyway!

In a previous blog entry, I explained how to mount a RAM-drive on Ubuntu and use it as a development folder for much higher performance in the compile-test-run cycle. I have to admit, I don't use this for each and every project since it's a little complex and fragile.

But there's an interesting compromise to be had here. It turns out it is possible to instruct Maven to build artefacts to a RAM-drive. That way you not only gain some performance but also some automatic "garbage collection" in that by the next boot, you will have no traces of these build steps laying around. It would also be a very healthy thing to do if you're running from of an SSD drive, whic…

The pain of request scoped JSF

While I like the idea of a component based web framework, JSF never really felt right to me. There are too many pitfalls and the whole programming model (even with the use of Facelets) feels cumbersome and more complex than necessary. I could probably write up a detailed list of reasons for why I think JSF is the least productive and fun web frameworks of those I know, but that is not the purpose of this blog post. Suffice to say this appears to be a shared sentiment. This post addresses only JSF's focus on server state and the associated overloaded POST aspect.

The problem of state
All programs that does anything remotely interesting, needs to keep some kind of state. In web applications, there are really only two places to put state and that is either on the server or on the client. Because HTTP itself is stateless, most frameworks stores state on the server in a session that is allocated the very first time a unique user visits. This is done either through an associated cookie or…