Mobile & Gadgets

Cant download large apps from Android Market

If you are running a rooted Android phone and have problems with downloading large apps from the Android market, one fix can be to move the market download folder over to the SD-card, install a terminal emulator and perform the following (on your own risk of course):

mkdir /mnt/sdcard/market-download-cache
cd /cache
mv download download.bak
ln -s /mnt/sdcard/market-download-cache download
ls -ahl

Then try again and see if it wont work better to download large apps, like Google Maps 🙂

Development Java

Java: Converting long to double

While Integers has to be parsed from a String, doubles can simply be casted:

String bar = "9.99";
Double foo = (double)bar;

EXT GWT: Adding onClick to Labels

I had a issue where i needed to add a click handler for labels in EXT GWT, the solution i came up with was as follows

theLabel.addListener(Events.OnClick, new Listener() {
public void handleEvent(BaseEvent be) {
    // TODO Auto-generated method stub



Guice: java.lang.IllegalStateException: No SessionHandler or SessionManager

One reason for this error would be that you should inject the session object directly, not via constructor:

So instead of:

public class Foo {

@Inject public Foo(HttpServletSession s) {
this.session = s  }

do this:

public class Foo{

@Inject Provider<HttpServletSession> session;


And it should work much better 🙂

Hardware Linux Software

Expanding a kVM disk image

Had to expand a KVM virtual machine today. Luckily, that`s pretty straight forward. You simply create a new disk image with the extra size needed, merge it into the original disk and voila. Then you just need to partition in the extra space and you are good to go.


1: Halt your virtual machine.

You need to stop your virtual machine before going wild with the drive. Virsh stop <vm name>, or virsh destroy <vm name> if it somehow wont stop.

2: Create a disk with the extra space needed:

qemu-img create -f raw 5gig.img 5G

3: Merge it into the disk you are working with

cat 5gig.img >> yourdisk.img

4: Boot up and and partition your drive.

Then start up your virtual machine again with virsh start <vm name>. If you use Windows server, all you need to do is to visit disk managent, right click your drive with little free space and choose “extend partition”. The job takes seconds and does not require any reboot.