Building Android from AOSP -- goals, setbacks and achievements

"How hard can it be?" is a question that I have hopelessly asked myself too many times down the road. The answer is almost never "Give me five minutes and I'm done" because for me there's no such thing as an easy task to undertake. Case in point is my latest hobby, if it can be named as such, building Android 4.2 Jelly Bean from the Android Open Source Project. Do you still remember the question?

The idea is to get a working Android 4.2 Jelly Bean-based build with only minor alterations, that I apparently cannot find anywhere else combined in an already available custom distribution. My requirements are fairly simple at first glance, as I only want a center clock, blacked-out Settings menu, to remove a few tiles and add new ones and, maybe, add some Linaro optimizations to the build. Straightforward, right?

I have to concede that when I originally thought about it my enthusiastic self took charge that I almost immediately forgot just how tiresome it can be to spend countless hours researching solutions for otherwise nonexistent issues. The Android 4.2.1 factory images are basically without fault and there is no extra work involved -- everything works out of the box, which is something that I cannot say about the stock AOSP build.

"Google does have a guide that you can follow, right?" True, but that is like saying Google cannot omit certain crucial aspects. I actually made the mistake of falling into that very same trap. The Mountain View, Calif-based corporation likely thought of hardcore developers that already have a deeper knowledge into building Android when that guide was posted, and forgot to adjust for first-time "builders".

Needless to say I managed to compile Android 4.2.1 for my Google Galaxy Nexus. The process took a considerable amount of time, which is to be expected when running Ubuntu 12.04 inside a virtual machine on a four-year old laptop, but delivered an unusable AOSP-based build, which is not to be expected. The camera crashes with every app opening, the GPS is nowhere to be found running, the Google account cannot restore any backed up information and there is no Email app compiled, when it should be.

Comedy of Errors

Let me talk you through each. The camera and GPS module, among others, use proprietary binaries that Google cannot or does not want to include alongside the AOSP build. All proprietary binaries must be downloaded and extracted, individually, into the folder where the source code is placed. The problem is that even so neither works because there are some files missing, which Google makes no mention about.

Those missing files are, obviously, crucial and must be pulled from the corresponding factory image and added to the respective vendor folder. Afterwards two .mk files must be edited as to insert the missing file names and take them into account when compiling the build. In order to deliver stock-like functionality Google's location provider must also be added to a different configuration file. Did I sign up for this? No.

By default Google's factory images allow users to restore all the backed up information after signing in with a Gmail account. That means that previously used apps, settings, WiFi networks, passwords and so on will be pulled from Google's servers and onto the phone or tablet. However, the backup transport service does not use the right path to do so, a "feature" that must be enabled by adding two lines of code in the corresponding configuration file.

The missing Email app from the final build can be attributed to the wrong naming scheme used by Google in the AOSP source. Instead of the "Email" package the source code references to a nonexistent "Email2", an issue that has been promptly reported by developers, causing the compiler not to add the app in the final package. It's frustrating, but easily fixable by (again) editing the corresponding file to remove the extra "2" from the name. Must be Google's way to make users download the dreadful Outlook app for Outlook Exchange functionality.

Had I known about all the issues would I still be interested in "rolling my own"? Yes, you bet. It's an interesting experience and I am going to slowly take my time with my little AOSP project. Sometimes it's not about the end result, it's the journey that is the most rewarding. I know what I want and I can estimate what the end result will be, but the accumulated knowledge is priceless.

Photo Credit: Joe Wilcox

2 Responses to Building Android from AOSP -- goals, setbacks and achievements

© 1998-2024 BetaNews, Inc. All Rights Reserved. Privacy Policy - Cookie Policy.