Table Of ContentPraise for Embedded Android
“This is the definitive book for anyone wanting to create a system based on Android. If you
don’t work for Google and you are working with the low-level Android interfaces, you
need this book.”
—Greg Kroah-Hartman, Core Linux Kernel Developer
>
m
o
c “If you or your team works on creating custom Android images, devices, or ROM mods,
k.
oo you want this book! Other than the source code itself, this is the only place where you’ll find
b
e an explanation of how Android works, how the Android build system works, and an overall
w
wo view of how Android is put together. I especially like the chapters on the build system and
w. frameworks (4, 6, and 7), where there are many nuggets of information from the AOSP
w
w source that are hard to reverse-engineer. This book will save you and your team a lot of time.
<
k I wish we had it back when our teams were starting on the Frozen Yogurt version of Android
o
Bo two years ago. This book is likely to become required reading for new team members
e
w! working on Intel Android stacks for the Intel reference phones.”
o
W —Mark Gross, Android/Linux Kernel Architect, Platform System
m Integration/Mobile Communications Group/Intel Corporation
o
d fr
a
o
wnl “Karim methodically knocks out the many mysteries Android poses to embedded system
o
D developers. This book is a practical treatment of working with the open source software
project on all classes of devices, beyond just consumer phones and tablets. I’m personally
pleased to see so many examples provided on affordable hardware, namely BeagleBone, not
just on emulators.”
—Jason Kridner, Sitara Software Architecture Manager at Texas
Instruments and cofounder of BeagleBoard.org
“This book contains information that previously took hundreds of hours for my engineers
to discover. It is required reading for any new person that is working with Android
on my team.”
—Dr. Mark Micire, Researcher in Space and Mobile Field Robotics,
Carnegie Mellon University
“Thanks to this book, for the first time embedded system developers have access to an open
and vertically integrated stack that contains everything they need to build robust and high-
performing Linux-based products. Android’s revolutionary execution model transcends
phones and tablets, and its application developer platform is unmatched in the industry for
features and development speed. This book will give developers a valuable resource for
understanding everything between the application layer and the kernel, and how to extend
and change things to create an infinite variety of Androids.”
—Zach Pfeffer, Tech Lead for Linaro’s Android team
“Finally, a book on the Android platform from a systems perspective! There are plenty of
books on creating Android applications, but for too long no single, comprehensive source
for information on Android’s internals. In Embedded Android, Karim has collected a vast
quantity of material that is essential and helpful for Android systems programmers and
integrators (although, to be sure, application developers would benefit from a reading as
well). Karim’s copious examples, references, and explanations are gleaned from his extensive
experience with and analysis of Android. It’s the book I wish I had had when I walked my
own trail of tears learning Android for work at Sony. With this book, I could have saved
myself months learning the ins and outs of Android. No doubt this will be the canonical
reference book for Android system developers for years to come.”
—Tim Bird, Senior Staff Engineer, Sony Network Entertainment,
and Architecture Group Chair, CE Workgroup of the Linux
Foundation
“Karim Yaghmour’s book is an excellent guide for those wishing to get into the burgeoning
field of Android-based embedded projects and products. The book covers the full range
from kernel support through licensing and trademark issues, including information on
running Android systems in “headless” mode as well. This book deserves a place on every
serious embedded Android developer’s bookshelf.”
—Paul E. McKenney, IBM Distinguished Engineer and Linux
Kernel RCU Maintainer
“Although Android is officially designed for mobile and tablet segments, it’s unquestionably
getting considered for many other product segments, like automotive, UI panels like HMI,
wearable gadgets, and so on. This book is highly recommended, as it covers all the essential
fundamentals and concepts that help developers port and develop Android-based solutions
for both mobile and nonmobile product segments.”
—Khasim Syed Mohammed, Lead Engineer, Texas Instruments
“A great resource not only for embedded Android developers, but also for Android app
developers to learn the wiring below the Java surface.”
—Lars Vogel, CEO, vogella GmbH
“Once again, Karim has hit the nail on the head. If you’re interested in porting Android to
a new device or just interested in the guts of how Android runs on a piece of hardware, this
is the book you’ve been searching for. This book leads you through all of the facets of build-
environment setup, getting the AOSP sources, adding your hardware to the Android sources
and deploying a new Android build to the hardware. It discusses the underpinnings of
Android including the HAL and how to give your custom hardware support within the
Android framework. In short, of all the books on Android, this is the one book that targets
the Android device builder rather than Android application developer or end user. I just
wish this book would have been available when I first got into Android porting. It could
have saved me months of trial and error efforts.”
—Mike Anderson, Chief Scientist, The PTR Group, Inc.
“Embedded Android has been a great resource for our company. It is a must-have when
porting Android to new hardware or integrating new features at a low level. Karim is a great
instructor, and his writing captures his style well.”
—Jim Steele, VP of Engineering, Sensor Platforms
“Embedded Android is a must-read for anyone who wants to seriously work the Android
internals and bring up Android on new platforms. It helps in navigating the extensive AOSP
codebase, and understanding the overall architecture and design of the system.”
—Balwinder Kaur, Senior Member, Technical Staff, Aptina
Imaging
“So you thought you knew about Android internals? Well, think again! Chapter after
chapter, you’ll discover what’s behind the scenes and why Android is not just another
embedded Linux distribution. Get yourself ready for stepping into a whirlpool, ’cause
Embedded Android is a gold mine for anyone looking to do serious hacking on
Google’s OS.”
—Benjamin Zores, Android Platform Architect, Alcatel-Lucent
“Definitely one of the most valuable and complete resources about the Android system stack.
A must-have for every Android system engineer.”
—Maxime Ripard, Android Lead, Free Electrons
“When I was handed a development board running Linux, and was told to ‘get Android
running on it,’ it was difficult to find much information about how to bring Android up on
a new device. Luckily for me, Embedded Android became available about the same time
that I was beginning development. What a lifesaver! Embedded Android gave me the kick-
start I needed to understand the underpinnings of Android and what I would need to do to
bring Android up on a new piece of hardware. I loved all the details and background, from
the boot sequence to the build system. After having read Embedded Android, I felt I had a
much better grasp of Android and how it interacted with the Linux kernel.”
—Casey Anderson, Embedded Systems Architect, Trendril
Embedded Android
Karim Yaghmour
Embedded Android
by Karim Yaghmour
Copyright © 2013 Karim Yaghmour. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/
institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editors: Andy Oram and Mike Hendrickson Indexer: Bob Pfahler
Production Editor: Kara Ebrahim Cover Designer: Randy Comer
Copyeditor: Rebecca Freed Interior Designer: David Futato
Proofreader: Julie Van Keuren Illustrator: Rebecca Demarest
March 2013: First Edition
Revision History for the First Edition:
2013-03-11: First release
See http://oreilly.com/catalog/errata.csp?isbn=9781449308292 for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly
Media, Inc. Embedded Android, the image of a Moorish wall gecko, and related trade dress are trademarks
of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trade‐
mark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume no
responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.
ISBN: 978-1-449-30829-2
[LSI]
To Anaïs, Thomas, and Vincent.
May your journeys be filled with the joys of sharing and discovery.