Android™ Internals Training Course
Course Summary
Android Internals training course is designed for those who are already familiar with basics of Android SDK and are looking to customize and/or extend the functionality of the platform.
Android Internals focuses on Android NDK and Android IDL APIs to give you a clean access to the underlying hardware and services with future compatibility in mind. You will learn how to build custom images and hack the platform.
Now extended to 5 days!
[top] Duration
5 days.
Android™ Internals is composed of the following:- Android Overview Module (1 hour)
-
Android Stack Module
(1 day)
- Android Kernel Layer (3 hours)
- Android Native Layer (2 hours)
- Android Application Framework Layer (1 hour)
- Android Applications Layer (1 hour)
- Java Native Interface (JNI) and the Android Native Development Kit (NDK) (4 hours)
- Android Inter-Process Communication (IPC) with Binder and AIDL (4 hours)
- Android Security Essentials (3 hours)
- Building Android from Source (2 hours)
- Android Startup (2 hours)
- Android Subsystems (3 hours)
- Creating a Customized Android System Image (1 day)
- Android Tools and Debugging (2 hours)
[top] Objectives
By completing Android Internals training course you will be able to:
- Explain the anatomy of the Android platform and get is physiology (layer interactions)
- Build native applications in Android using JNI and NDK
- Take advantage of Android AIDL to build IPC-enabled bound services
- Build the entire Android platform from source and get what's what
- Customize and extend the Android platform to build custom ROMs
- Modify and extend Android frameworks and services
- Take advantage of custom hardware with Android
- Understand where Android departs from standard Linux
[top] Audience
This Android Internals course is for developers who want to dig deeper than the standard Android SDK. It is for those who want to hack the system a bit in order to add system services and hardware support for non-standard components or port Android to completely new boards.
[top] Prerequisites
Java
To take this course, you must know Java. You should be able to answer most of the following questions:
- What is a difference between a class and an object?
- What is the difference between static and non-static field?
- What is the difference between extends and implements keywords?
- What is an anonymous inner class?
- What is the purpose of @Override?
To refresh your Java skills you can review Marakana Java Tutorial to get up to speed.
Additionally, knowledge of Eclipse is required. You could watch this 30-minute tutorial to get up to speed with Eclipse.
C/C++/Make
To get the most benefit from this class you must have a basic understanding of C and C++. For example, you should be able to answer the following:
- What is a header file?
- What is gcc and how to use it?
- Basic usage of sprintf()
- What is make and how does it work?
- Be able to read and understand basic Makefiles.
- Be able to read and understand shell scripts.
Linux
You should be familiar with basic Linux operating system. For example, you should be able to answer the most of the following:
- How do you use use the following commands: ls, ps, cp, mv, pwd, cat, chmod, chown, mount, and similar.
- What is the init process?
- What are users and groups in Linux and how do r/w/x permissions work?
[top] Instructors
Aleksandar Gargenta is the technology brains at Marakana. Always on top of the latest in software, Aleksandar is the company's radar for technology that matters. His latest ventures are perfecting Marakana's Android Internals and Security courses.
Phew. And if that's not enough, he's also the chief architect of Marakana Spark, the on-demand software platform that powers marakana.com and a number of other training companies. As an instructor he's taught hundreds of classes for everyone from Apple to Disney, from NASA to the Department of Defense.
In his spare time Aleksandar runs the San Francisco Java, Android, and HTML5 User Groups with over three thousand members across the three groups.
Aleksandar holds a bachelor’s degree in Mathematics and Computer Science from the University of Waterloo. He is also a father, photographer, hiker, and a race-car driver :-)
Dave Smith has spent the last decade working as an engineer and software developer in the embedded and mobile space from his hometown of Denver, CO. He is a lead team member at Double Encore, developing custom solutions.
Since 2009, Dave has worked as a consultant developing software at all levels of the Android platform; from writing user applications using the SDK to building and customizing the Android source code for embedded devices. Prior to that, he was an embedded applications developer and hardware systems integrator for the M2M industry, working mostly with 8 and 16-bit microprocessors. His favorite mobile projects are those that integrate custom accessory hardware with consumer devices or involve building Android for embedded platforms. Today he specializes primarily in integrating custom device interfaces, such as USB and UART, with application layer services on embedded Android hardware.
Dave is also passionate about providing resources for developers that they can make use of long term. He frequently shares ideas via his development blog and Twitter (@devunwired). He is the lead author of the popular Android book Android Recipes: A Problem Solution Approach published by Apress; a cookbook style text dedicated to getting Android developers up and running quickly by providing real-world useful examples of how to use the Android SDK and NDK to build applications quickly and well. Dave is a regular speaker at Android conferences, such as AnDevCon, where he usually speaks on topics related to hardware integration. He also often writes guest columns for the software development magazine SD Times, where he shares thoughts and opinions on mobile development.
Dave received his degrees in Electrical Engineering and Computer Science from the Colorado School of Mines, and is a licensed Professional Engineer.
More about Dave Smith...
Blake is an engineer with more than 20 years of experience, much of it with Java. He's built systems as large as Amazon's massively scalable AutoScaling service and as small as a pre-Android OSS/Linux and Java based platform for cell-phones.
He's currently deep in Android. Blake is co-author of three books on Android, including O'Reilly's best-selling, "Programming Android" and the Wiley's upcoming "Enterprise Android".


Blake writes the popular and informative blog "Portable Droid"
More about G. Blake Meike...
Ken Jones has thousands of in-class hours teaching advanced technical topics, and over 20 years experience in technical training and documentation targeted towards software developers. Ken has delivered training to various software development teams within the Fortune 1000 such as Cisco, Intel, IBM, Boeing, AT&T, Ericsson/Nokia, and many more. Ken's expertise spans multiple areas of software development; he has trained teams in Java, Javascript, Android, and advanced web development with HTML, CSS, and XML.
More about Ken Jones...
Marko founded Marakana back in 2001 to help underprivileged youth, minorities, and inner-city kids learn web technologies and get ahead in life. So Marakana emerged with goal of helping people get better at what they do professionally, focused on open source software training.
Marko is the developer of Marakana Android Training series. He has taught Android for companies such as Sony-Ericsson, Qualcomm, Ericsson Canada, and many others. Marko is a co-founder of San Francisco Android Users Group and regularly teaches Android Bootcamp at Marakana.
Marko is author of Learning Android book published by O'Reilly Media. This book is based on Android Bootcamp and incorporates best learning practices for new developers to start creating applications for this exciting open source mobile platform.
Marko is also the co-chair of Android Open, an O'Reilly conference focusing on Android ecosystem.
In 2006 Marko Gargenta published "PHP and MySQL By Example", a collection on PHP examples. The book was published by Prentice Hall, world's largest technology publisher and has been also translated to Spanish.
Marko Gargenta obtained his Bachelor of Mathematics Degree from University of Waterloo (Canada's MIT) and has been developing in Java since 1996. He lives in San Francisco, California.
More about Marko Gargenta...[top] Outline
Android Overview Module (1 hour)
This module introduces you to the Android operating system to ensure a basic familiarity with the Android architecture, background, and terminology. You also learn additional sources of information for modifying the Android OS, porting it to new hardware, and complying with Google's Android compatibility requirements.
- Overview of the Android platform architecture
- Introduction to the structure and lifecycle of Android applications
- Internet resources for Android platform developers
- Android compatibility requirements: the Compatibility Definition Document (CDD) and Compatibility Test Suite (CTS)
Android Stack Module (1 day)
The Android OS is categorized into four layers. From the bottom up they are the kernel layer, the user-space native layer, the application framework layer, and the applications layer. In this module you explore each of the layers in depth to understand their role and the components they contain.
Android Kernel Layer (3 hours)
In this module you learn how Google has extended the standard Linux kernel for Android and how the upper layers of the Android OS interact with these extensions.
- Where to find the source for Android's custom kernel
- Binder: Android's primary inter-process communication (IPC) mechanism
- Anonymous shared memory (ashmem): Android's replacement for POSIX SHM
- Android's physical memory allocator, ION
- Android power management extensions: wakelocks, early suspend, and alarms
- Android's low-memory process killer
- The Android logging system
- Android's user and group management and kernel security enforcement (the "paranoid network security" kernel option)
Android Native Layer (2 hours)
In this module you explore the portion of Android user-space that is implemented in native C/C++ code. You learn: in what ways Android's libc implementation, Bionic, is not POSIX-compliant (and why); how Android's user-space Hardware Abstraction Layer (HAL) defines a standard API for exposing hardware to the rest of the Android OS; what significant libraries, frameworks, and daemons are incorporated in Android; and how Android's Dalvik Virtual Machine (VM) enables both application and platform developers to write Android code in Java.
- Bionic: Android's implementation of libc and how it differs from the BSD libc
- User-space Hardware Abstraction Layer (HAL): standard APIs for accessing hardware
- Overview of standard Android native daemons (e.g., adbd, rild, ueventd, etc.) and their purpose
- Overview of other Android function libraries and frameworks
- The Dalvik Virtual Machine (VM) and how it differs from a Java VM
Android Application Framework Layer (1 hour)
Android's application framework layer not only exposes a Java API for application developers, but also implements much of the Android operating system in Java. In this module, you discover how Java-based system services manage the operating system, applications, and device hardware. You also learn the general model by which client-side manager classes interact with these system services through Binder IPC to access system features.
- System service architecture
- Significant system services and their roles (e.g., ActivityManagerService, PackageManagerService, ConnectivityManagerService, etc.)
Android Applications Layer (1 hour)
This module describes the basic structure of an Android application and how it is distributed as an Android application package (APK). It also identifies the standard set of Android system applications and where they are implemented in the source distribution.
- Android application structure
- Standard Android system applications, wallpapers, and input method editors
Java Native Interface (JNI) and the Android Native Development Kit (NDK) (4 hours)
Much of the Android platform is implemented in Java, and yet that code needs to access functionality written in C/C++ and compiled to native machine code. Additionally, an application developer may want to implement portions of an app in C/C++ for performance or to incorporate existing native libraries and frameworks.
Java Native Interface (JNI) is a standard Java technology for integrating Java and native code. In this module, you learn the fundamentals of JNI and how to use it as a bridge between the native and Java-based runtimes. You also learn how to use Android's Native Development Kit (NDK) to implement portions of an application in native code and distribute it for use on multiple machine architectures.
- JNI development process overview
- Implementing Java methods in native code
- Mapping Java types to native types
- Managing object references in native code
- Managing Strings, arrays, and other Java object types in native code
- Throwing and catching exceptions in native code
- Using NDK to incorporate native code in an app
- Supporting multiple machine architectures with NDK
- NDK "stable" APIs
- Lab: NDK
Android Inter-Process Communication (IPC) with Binder and AIDL (4 hours)
Binder is Android's primary inter-process communication mechanism. (In fact, most standard POSIX IPC mechanisms are not available for use in Android.) Even higher-level Android IPC techniques, such as broadcast Intents and interactions between system services and client-side manager classes, use Binder as the underlying transport mechanism.
In this module, you learn: the capabilities of Binder; how to generated Binder-based interfaces in Java using Android Interface Definition Language (AIDL); how Binder is used by client-side manager classes to communication with system services; and how applications can expose their own Binder-based interfaces to other applications.
- Overview of Binder and its capabilities
- Higher-level Android IPC mechanisms based on Binder
- Binder communication and service discovery
- Generating Binder-based service interfaces in Java using Android Interface Definition Language (AIDL)
- Creating custom Parcelable Java types for use with Binder
- Exposing a Binder-based interface from an application
- Asynchronous Binder interactions
- Binder limitations
- Binder security
- Detecting and handling Binder "death notifications"
- Lab: Binder-based application service
Android Security Essentials (3 hours)
Android extends standard Linux security to control access to device features like network interfaces, cameras, and stored personal information. In this module you learn how Android's permission model interacts with standard Linux security and how to define and enforce custom permissions to restrict access to system extensions.
- User and group ID management
- Android permission enforcement
- Declaring custom Android permissions
- Lab: Custom permissions
- Securing application components using permissions
Building Android from Source (2 hours)
In this module you learn how to set up an Android build system, download the Android source, build Android system images, and run them on emulators and real hardware.
- Setting up an Android build system
- Obtaining the Android source tree
- Selecting the target product and build variant
- Building Android system images from source
- Running custom Android images on emulators and real hardware
Android Startup (2 hours)
This module describes Android system startup including bootloading the kernel, launching standard Linux daemons, and initializing a variety of Binder-based system services. It also explains the importance of the Zygote daemon for reducing Android application startup time and memory consumption. Additionally, you learn how to customize the system boot process through custom init scripts.
- Bootloading the kernel
- The init process and Android's init scripting language
- The standard boot process and how to customize it
- The purpose of the Zygote daemon
- Startup of system services
Android Subsystems (3 hours)
This module presents an architectural overview of several of the most significant Binder-based system services in Android, explores interactions between services and client processes and between the various Android platform layers, identifies key source files in the implementation of the services, and provides references to additional resources for subject matter experts to extend and modify many services.
- Vibrator
- Power Service
- Alarm Service
- Package Service
- WiFi Service
- Location Service
- Android Media Framework
- Telephony
- Device Policy Service
- SurfaceFlinger
- Camera Service
- NFC Service
Creating a Customized Android System Image (1 day)
This module integrates concepts from the entire course in the hands-on creation of a custom Android system image. You learn how to implement customizations at all Android stack levels, including custom kernels, HAL user-space libraries, executables, daemons, Java libraries, system applications, and Binder-based system services. Additionally, you'll learn how to support third-party developers for your Android devices by creating an SDK add-on that exposes your custom Java APIs and provides developers with a custom image they can use to create Android Virtual Devices (AVDs) on which they can run and test their code.
- Setting up a custom device directory structure
- Registering a custom device with Android’s build system
- Adding the Makefile plumbing for a device
- Generating platform signing keys (Optional)
- Adding a custom kernel
- Adding a custom native library and executable
- Adding a custom daemon
- Creating a custom Java library to expose a native library (i.e., JNI in the platform)
- Consuming a custom Java/JNI library via a custom application (Optional)
- Implementing a custom Binder-based system service
- Building a custom application using a custom client-side manager class
- Creating and distributing a custom SDK add-on to support third-party developers (Optional)
Android Tools and Debugging (2 hours)
In additional to standard utilities for monitoring and troubleshooting Linux-based systems, Android includes several custom tools of its own. This module shows you how to use these tools to monitor and troubleshoot the Android kernel, processes, system services, and applications.
- Debugging native code on Android
- Debugging Java code on Android
- Debugging applications and system services
[top] Additional Notes
Android Meetup Group Organized by Marakana
Marakana team organizes and runs the San Francisco Android Users' Group - an interactive group of Android developers. In our monthly meetings, we discuss Android landscape from both technology and business angles. We often have great presentations by industry experts, group discussions, as well as hands-on sessions. If you are in San Francisco Bay Area, we encourage you to join the group and meet other Android developers.
Trademark Notice
Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
[top] Student Testimonials
Marko was an excellent instructor. I feel very confident with the information I've learned over the past few days. Thanks.
Great content and excellent presenter and tutor!
Thanks for jumping into example code to answer our questions.
Great training! The training really knows Android Internals. Android Application lifecycle, startup and filesystem was explain really well.
Sasa is very good at explaining Android topics and gave us an excellent overview in a short time frame.
Aleksandra did an excellent job though overall and was able to adjust the material well to our queries.
Good material.
I have attended multiple training sessions over a period of 10 years but this is by far the best custom training I have been part of. Now I will have a short turnaround time to implement what I learned in my project thanks to the technical clarifications provided by Marko!
I think Marko is a skilled trainer, excellent class driving with excellent background, Marko rocks!
I thought the class moved at a good pace. I am glad that the instructor did not expect us to be Java programmers and made us code in Java all the time. It made the class more enjoyable.
fast pace, compressed learning.
Marko is very knowledgeable and explains the entire Android System clearly and effectively. The training is going to help us tremendously!
The instructor did a great job of imparting complex information at a rapid clip. Hands-on activities were challenging and interesting.
It is hard to rate everything as excellent but this really was an excellent course. Marko was very knowledgeable and knows how to present this work. I will surely benefit from having had this course. Great class and excellent instructor.
Thank you very much for your great presentation
Very Good instructor!
Marko was great, he explained stuff really well, he gave personal attention to everybody in the class. He knew his stuff very well and he kept the class at the right pace. Thanks Marko!! It was great having you here..
Thank you so much pretty nice training.
Great class. Tailored content to fit participants needs. Marko answered questions related to specific use-cases, and if didn't know the answer, then showed us how to find answer via lab experiment. Thank you!
Actually, I am now wondering to attend your 5 days training to learn more about Android application develpment.
Marko is extremely knowledgeable. Excellent class! Fantastic jump start into Android development!
Excellent instructor. Knowledge of the subject is clearly extensive. Very good course material, I will definitely keep it for reference. Appreciated the tailoring of the material to our needs.
I think the training was very valuable for me and it will be very helpful to my feature work.
Very good.
This course was actually better than a previous course I had done at a university extension in terms of instructor knowledge and overall content. Also, since it was tailored and relevant to the company, it was great.
Quite a lot gets covered in 2 days. Will give any one a quick start. Thank you, enjoyed it.
Great training class.
Provided a good understanding of the interaction between fundamental pieces of Android framework.
I like the pace. Very fast. Before this class I had not touched the Android build. I had only created a few small apps. I felt I was able to keep up because of the organization of the class.