Instant Android Systems Development How-to
Copyright 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2013
Production Reference: 1170513
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84951-976-2
www.packtpub.com
Credits
Author
Earlence Fernandes
Reviewers
Boris Farber
Yury Zhauniarovich
Acquisition Editor
Usha Iyer
Commissioning Editor
Sharvari Tawde
Technical Editor
Dominic Pereira
Project Coordinator
Esha Thakker
Proofreader
Bernadette Watkins
Graphics
Abhinash Sahu
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
Cover image
Conidon Miranda
About the Author
Earlence Fernandes is pursuing a Ph.D. degree in Systems Security from the University of Michigan, Ann Arbor, USA. Previously, he was a Scientific Programmer at Vrije Universiteit, Amsterdam, where he built several Android research prototypes for various cutting-edge security mechanisms. He also co-authored several scientific papers on the topic. He has been playing with Android since 2008 and is an active member of the Android Google Groups for platform internals.
I would like to thank my undergraduate thesis advisor, Anthony Raj, for introducing me to Android all those years back. I would also like to thank my parents for providing the resources to pursue a career in Computer Science.
About the Reviewers
Boris Farber is an experienced Software Developer specializing in the Android platform and applications. He works on the most innovative Android projects in Israel, focusing on security, performance, and advanced UI. In addition, he has also developed the "Profiterole" Map-Reduce library for Android. Boris lectures in various conferences and user groups about Android and Software Design. He holds an MSc in Computer Science and an MBA in Marketing.
I thank my wife Inbar.
Yury Zhauniarovich received his MSc degree in Computer Science from the Belarusian State University in 2007. From 2007 till 2009, he worked as a SAP consultant and business analyst at Itransition.
He is now a Ph.D student at the University of Trento. Doing his research in the security of mobile operating systems, he has acquired cutting-edge knowledge of the Android platform. He has participated in the development of several research systems based on Android and has authored a few papers on this subject.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at > for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
- Fully searchable across every book published by Packt
- Copy and paste, print and bookmark content
- On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Preface
Welcome to Instant Android Systems Development How-to . This book provides a gentle introduction to the Android Operating System internals. If you've ever wondered about how Android works under the hood, then this book is for you. I have often wondered about this question, and I had to spend hours digging through thousands of lines of code to understand what Android really is. This book is a collection of my experiences working with this platform for more than three years now, and I hope it will ease the learning curve of Android systems development. Readers can instead focus on the core concepts and get started on building useful Android modifications in a short span of time. This book will get you started on building you own Android version. The book is comprehensive as it covers every aspect of Android systems development, right from downloading the source code, to flashing custom-built code on real devices.
What this book covers
Building Android gets you up to speed on downloading the Android source code and building it. This is a rite of passage for many aspiring Android systems developers, and this recipe will help you along that journey.
Source code organization and system startup is explained, as the Android code base is huge and effective development includes knowing your way around this code. The initial parts of these recipes introduce the reader to various parts of the source code. The later parts of these recipes describe in detail how Android boots.
Common design patterns in Android systems development covers the common patterns of systems code in Android. Knowing these patterns is crucial to developing high quality code. It also saves effort by describing several best practices.
Creating system servers recipes guide you through a complete example of creating a custom system server, which is one of the most basic design patterns in Android systems development. Everything from creating a basic interface file to adding the code to the existing bootup sequence is covered.
Analyzing Android system partitions explains the organization of system partitions on the Android emulator and several real devices. This knowledge is a prerequisite for learning how to correctly flash new OS builds to devices safely.
Compiling for a specific device understands that most readers will want to test their code in real devices; however, getting a build right for a particular device takes some experimentation and risk. This recipe aims to eliminate that risk by guiding the reader through well-defined steps to get a correct build.