2011-05-16

ParallelDroid

The video is showing Android running natively in a window on my desktop system. Source code for the patches and utilities I’m using is available at https://github.com/pakesson/ParallelDroid.

The basic idea of ParallelDroid is that the Android UI is rendered to a virtual framebuffer, which is then displayed in a GTK application written in C. Keyboard and touchscreen input is handled by a custom input driver, and you’ll need to blacklist your physical input devices in Android to avoid confusion when other windows have focus (see android/system/etc/excluded-input-devices.xml for an example).

You’ll need a kernel with the Android patches (binder, ashmem, logger etc.), as well as the modifications from /kernel in the ParallelDroid repository. The easiest way to accomplish this is to start with the common Android kernel tree (http://android.git.kernel.org/?p=kernel/common.git;a=summary). A working Android root file system can be built using AOSP or Android-x86.

When the patched kernel is running (you might want to load the virtual framebuffer module manually to avoid conflicts with other video drivers on boot), you can chroot into the root file system and run /init to start Android. After a few seconds, you should see the UI loading in the gtk-ui application.

I recommend that you use a virtual machine if you want to try this on your own. Don’t expect anything to work, and don’t blame me if your computer explodes.