Wednesday, February 24, 2010

Gimp annoyances in OSX

I realized I had to click twice on Gimp buttons to get the function to work - wasted some time undoing some damage when I forget to check if the functions were double clicked and activated.

To fix this double clicking annoyance, you'll have to change OSX's X11 settings.

Open Terminal app and type:

defaults write com.apple.x11 wm_ffm true

Restart X11.

Sunday, February 7, 2010

Powering down XPS 1210m webcam in Linux

The built in webcam is always an annoyance because it gets pretty warm and consumes power. It's pretty easy to disable it in Windows but for linux you will have to send the commands to suspend the device.

I've just reinstalled Ubuntu 9.04 and I had to disable it again.
To suspend the QuickCam in XPS 1210m:

1.switch to root
2. issue:

echo suspend > /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-7/power/level
echo suspend > /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5/power/level


You can read the power management writeup here:


Sunday, January 10, 2010

Android code finally coming together

Got the code up and running reasonably well, going collect my HTC Hero phone later. I'll load the apk in the device to give it a go.


Sunday, January 3, 2010

Back from Genting

Chilling out with friends, waking up neighbors with Rock Band and coding in the cool weather. Fun times.
Back to reality for now.

Saturday, January 2, 2010

Android app development on Netbooks

I like the size of netbooks, their small size means that you can bring them around easily. What I didn't anticipate was how underpowered the processor really was.

I've been doing development work on the Android platform and I wanted to use the netbook so that I can bring my code around and work on it when time permits.

Problem
Eclipse runs fine on the netbook but the emulator that comes with ADT is another matter. I was totally unable to launch my program from Eclipse using the emulator. It takes ages to get past the Android splash screen and I get a lot of error messages .

Speeding it up

Since android code runs on a Dalvik virtual machine, I could simply grab a x86 android machine and test my code on it. The x86 version should run pretty well on the netbook. I got a copy of Live-Android and a copy of VirtualBox x86 VM and tried the image.

Be sure to boot it using VESA in VirtualBox. Normal boot will produce strange flickering and blank screens.

It works!

How to install app onto Live Android

Live Android is a live cd, which means all data is transient. Once you reboot, all data will be wiped. That includes installed programs.

How do you get around it?

In Virtualbox, configure the Android vm, set your OS to Linux and Version to Linux 2.6
Create a hard disk (I used 100mb which is sufficient for my needs), attach it to the VM

Boot into Android Debug Mode.

You should see a Linux prompt, use fdisk(or cfdisk) to create 2 partitions.

Run "mdev -s" to create the device nodes for your new partitions.

Create file system for both partition
mke2fs -j -L /DATA /dev/sda1
mke2fs -j -L /SDCARD /dev/sda2
Reboot box

reboot -f

At the Android bootloader menu, select VESA and hit TAB, edit DATA=/dev/sda1 and SDCARD=/dev/sda2
Hit enter to resume boot.

To verify that you have mounted both partitions - hit ALT + F1 and issue "mount"

You should see /dev/sda1 and /dev/sda2 mounted.
That's it for the VM configuration. Remember to issue the boot options every time you reboot. I save the machine state when I need to shut it down so I don't have to go through that step every time.

Development Host

What you need:
  • Eclipse with ADT installed
  • Mongooose HTTP server (or any web server of your choice)


  1. In Eclipse, right click on your project, select Android Tools->Export Signed Application
  2. Follow through the dialogs, if you don't have a new keystore and key, create it now.
  3. Export it to a directory( say e:\projects\Exports)
  4. Copy mongoose.exe into e:\projects\Exports
  5. Run mongoose.exe

In Android VM

Configure the Application Settings to allow Unknown Sources

Launch browser, open HTTP://192.168.56.1:8080

You should be able to browse your directory. Download your apk and launch it.

That's it!






Resources

Mongoose HTTP server (http://code.google.com/p/mongoose/)