Porting Android on embedded platforms: a step-wise approachThe advent of Google’s open source Android distribution of the Linux OS has generated tremendous interest in the developer community to customize/port the same for their products running on other embedded platforms. These devices include mobile computers, vehicle mount devices, digital TVs, set-top boxes, video conference devices, and game boxes amongst others.
The advantage of making Android available to multiple device platforms signifies that applications, and features developed for one device could easily be made available for another platform with minimal porting needs, thereby allowing developers to focus their efforts more on introduction of new products in the market.
Given that Android is a Dalvik Virtual Machine Monitor-based software OS that runs on a Linux-based kernel, in order to port an Android platform one needs to port the underlying Linux OS and thereafter the Android stack (Figure 1).
Figure 1: Android Architecture
For porting Android on other embedded platforms, a 4-step approach is recommended:
- Step #1: Porting feasibility check
- Step #2: Porting and booting Linux on the reference platform
- Step #3: Porting Android onto the reference platform
- Step #4: Enable Non-working modules/drivers/applications
Step #1 ensures the feasibility and gathers the list of working and non-working functionalities. While Steps #2 and #3 largely involve independent activities, but some customization might be required in the Android core libraries once the Linux drivers are installed. As and when the device is loaded with Android, many of the components might not work because of the difference in configuration of the hardware abstraction layer (HAL) or missing drivers and libraries. However, these components get enabled in Step #4.
Porting to a vehicle mount computer
To understand better, let’s look at an example of Android porting on an embedded device (vehicle mount computer) which is based on x86 architecture:
Porting feasibility check
The default Android x86 image needs to be installed on a target device to perform the feasibility check. It certainly involves some efforts to get the system up and running! We also need to collect the list of working and non-working functionalities. Working functionalities can be display, USB, etc and non-working can be touch screen, Ethernet.
Porting and booting Linux
The main steps for porting Linux are (1) to install bootloader and (2) build the kernel image and bring the kernel up.
Since we selected x86 architecture platforms, GRUB is a good bootloader to extract. Now put the boot medium into the target device and power on the device to boot with the just installed GRUB. If GRUB is installed properly, the “Run Android” option will appear on screen.
The kernel image can be used from the Linux kernel archives or using android-x86 repo. Then the user needs to select the Android configuration file from /arch/x86/configure path and compile it. Once we get a compiled kernel image, we can instruct GRUB to select this image. After this step, the prompt will display “Detecting Android-x86…”
Page 1 of 2Next >