Android Internals Training Course
The Android Internals training course is designed for those who are already familiar with basics of the Android SDK and are looking to customize and/or extend the functionality of the platform.
Android Internals focuses on the Android NDK, and Android IDL APIs, to give you a clean access to underlying hardware and services, with future compatibility in mind. You will learn how to build custom images and hack the platform.
5 days.Android Internals is composed of the following:
- Android Overview Module (1 hour)
- Android Stack Module (1 day)
- 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)
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
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.
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 our NewCircle Java Tutorial.
Additionally, knowledge of Eclipse is required. You could watch this 30-minute Eclipse tutorial to get up to speed.
To get the most benefit out of 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
You should be familiar with basic Linux operating system. For example, you should be able to answer 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?
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...
Gil Zhaiek joined the NewCircle team from Vancouver, Canada and provides his expertise in the Android framework and the Linux kernel. He has 13 years of software and hardware experience that is critical for the field of board bring-ups. He started as a C++ coder of an online financial calculator, switched to FPGA and digital board design for a couple of years, and later integrated his knowledge in designing C++ Testbenches as a consultant to various hardware teams in more than 20 companies.
Having experience in nearly all the hardware and software components, he was able to transition smoothly to Real Time OS with Embedded Linux where he wrote drivers and was able to debug the hardware independently. A few years ago, Gil and his wife moved to Vancouver where he joined Recon Instruments as the Senior Embedded Android Engineer and later the Embedded Software Manager responsible for board bring-ups and Android framework customization.
Some of Gil's notable products he worked on include the MOD Live which was the first Ski Smart Head-Mounted-Display and the Recon Jet - a light sports HMD.
Gil earned his B.Sc in Mathematics and Computer Science from the University of Arizona. He also holds an MBA from Heriot-Watt University.More about Gil Zhaiek...
Justin is a driven, entrepreneurial, serial CTO with 35 years in the business of video games, developing and delivering titles on 26 platforms. He is creator/co-creator of dozens of land-based casino and social casual casino games, successfully developing a number of F2P and real-money gaming related properties.
He has worked on such franchises as Civilization, Pitfall, Hotwheels, Tyco, Star Wars, Shrek and Battletanx and with Disney, eBay, Microsoft, Apple, Lucasarts, Activision, Mattel, Vivendi Universal and SONY as clients. Justin has extensive experience with consumer facing commercial software, large-scale websites and other types of digital and physical products.More about Justin Lloyd...
Larry has spent over 16 years leading teams, designing and developing software and embedded systems for multiple markets. His ability to understand complete systems and the software stack has lead to high quality and high performance designs. In addition to developing device drivers, platform software and applications, Larry has developed and presented training for internal teams, end customers and technical conferences on highly technical content. Larry is currently the CTO and co-founder of HiQES, a engineering services company.
Five years ago, Larry was tasked with leading a new team to do Android platform software development, so he has experience diving headlong into new technology. Larry spearheaded internal ramp-up of developers, developing Android kernel drivers and middleware, and native code starting with the first public releases of Android. In fact, Larry was developing native C/C++ services and apps for Android before the first release of the Android NDK! Since that time, Larry has been the lead developer on three different new Android platforms, multiple Android platform extensions and applications.More about Larry Schiefer...
Marius Mailat has been developing commercial software since 2000. His focus is mobile applications architecture and development for Android, QNX and iOS.
He is an experienced Java developer who spent the majority of his career building large-scale Java applications for Xerox and Sabre Travel Network in Germany.
Android projects in which he has been involved are banking interfaces and shopping tools for Android. His interest in the secrets of Android platform was geared towards building Defense Squad Mobile Security app, a free, simple to use and innovative Android security solution. Marius is the founder of the Romanian Android Community Androider.ro which has now around 5000 active members.More about Marius Mailat...
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
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
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.
- Power Service
- Alarm Service
- Package Service
- WiFi Service
- Location Service
- Android Media Framework
- Device Policy Service
- Camera Service
- NFC Service
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
Additional Notes [top]
Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.
Student Testimonials [top]
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..
Great training class.
Thank you so much pretty nice training.
fast pace, compressed learning.
Very Good instructor!
I think Marko is a skilled trainer, excellent class driving with excellent background, Marko rocks!
Great training! The training really knows Android Internals. Android Application lifecycle, startup and filesystem was explain really well.
Aleksandra did an excellent job though overall and was able to adjust the material well to our queries.
Marko was an excellent instructor. I feel very confident with the information I've learned over the past few days. Thanks.
The instructor did a great job of imparting complex information at a rapid clip. Hands-on activities were challenging and interesting.
Quite a lot gets covered in 2 days. Will give any one a quick start. Thank you, enjoyed it.
Larry was a very knowledgable instructor. He was able to answer nearly all questions and the few that he didn't know the answer to right away, he would follow up with an answer later. He was approachable and a patient and I learned a lot from him. The class was pretty fast-paced, but that is to be expected when it is so condensed. I will probably go back through the slides to go over some of the material that I didn't understand in depth the first time.
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.
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.
Marko is very knowledgeable and explains the entire Android System clearly and effectively. The training is going to help us tremendously!
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.
Actually, I am now wondering to attend your 5 days training to learn more about Android application develpment.
Thank you very much for your great presentation
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 the training was very valuable for me and it will be very helpful to my feature work.
Great content and excellent presenter and tutor!
Sasa is very good at explaining Android topics and gave us an excellent overview in a short time frame.
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.
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.
Thanks for jumping into example code to answer our questions.
Marko is extremely knowledgeable. Excellent class! Fantastic jump start into Android development!
Provided a good understanding of the interaction between fundamental pieces of Android framework.
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!