Overview
Some initial rough notes on building Android (http://www.android.com/about) for Balloon 3.
The hardware used for the initial proof of concept port (http://www.youtube.com/watch?v=YkOl6xyAHr8)
- Balloon 3
- Toppoly resistive touchscreen
- CUED breakout board
- A powered USB hub
- USB keyboard
- USB serial
- TDC Development Platform with Siemens MC55i module
Steps
The best place to start is with the kernel, find a kernel that works well with the Balloon, follow the instructions in SoftwareBuilding
You'll need to port the changes Google have made to the kernel (http://source.android.com/download) into the kernel you wish to use (note that some of the drivers now exist upstream in driver staging). These will include:
# CONFIG_ANDROID_GADGET is not set # CONFIG_ANDROID_RAM_CONSOLE is not set CONFIG_ANDROID_POWER=y CONFIG_ANDROID_POWER_STAT=y CONFIG_ANDROID_LOGGER=y # CONFIG_ANDROID_TIMED_GPIO is not set CONFIG_ANDROID_BINDER_IPC=y
- Check that the kernel still works as intended using whichever variant of build you are using.
- Now make the Android code at the top level, if all goes to plan you should have a system directory (out/target/product/generic/system) which can be placed on the Balloon 3
- As a quick sanity check of the Android build try using the Qemu based emulator on the PC
At the top level of the Android source tree enter: . build/envsetup.sh lunch 1 emulator -debug-all -verbose -logcat main
- Initialisation code, copy across the init and init.rc files from out/target/product/generic/root. The permissions to /dev/binder, /dev/ashmem, /data and /system/usr/keychars* may require some fettling if you are running Android without using the Android ramdisk (for example if you are booting of a variant such as Debian first)
- Once you have something that initialises okay then you can move onto tailoring Android for your hardware setup, for example if using a resistive display then some form of calibration is required, if using a modem then the radio interface layer needs to be written (Android supply a Hayes AT layer that can be easily altered for simple operations).
Tips
- You need to 'provision' the device so the home key, screen saver, incoming call and some other features work. To do that, when Android is running, use an Android adb shell:
adb shell
su
cd /data/data/com.android.providers.settings/databases
sqlite3 settings.db
INSERT INTO system (name, value) VALUES ('device_provisioned', 1);
.exit- You can achieve a quick turnaround on code change if you avoid make at the top level but use the mm command instead within the directory containing the Android.mk for the files you have altered. If using the emulator then you'll also need to remake the yaffs image using:
out/host/linux-x86/bin/mkyaffs2image -f out/target/product/generic/system out/target/product/generic/system.img
Guides
An overview of the steps is detailed in the Android porting guide, development/pdk/docs/index.html within the downloaded source tree.
https://groups.google.com/group/android-porting can be quite useful although you may need to search around. Most problems have already been hit by others.