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.
Now updated for Android Lollipop
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 is the Android Practice Lead at NewCircle, where he focuses on development and maintenance of courseware materials.
Dave has worked in developing software at all levels of the Android platform since 2009; 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 is the 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, where he usually speaks on topics related to hardware integration and framework internals. He frequently shares ideas via the NewCircle Stream, his personal development blog, Twitter (@devunwired), and Google+.
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...
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...
Ron is an entrepreneur and software development consultant. He has a long history of developing for performance and safety critical software, leading development groups, training application and platform developers, and helping companies in the process of board bring-ups. He also has experience with the design and execution of embedded systems products, security best practices and product start-up.
He specializes in all aspects of distributed systems and Android internals. As the Founder and CTO of Nubo, the first Remote Android Workspace for the Enterprise, he is the designer and original developer of the first Android Remote Display Protocol.
Additionally, Ron is a lecturer at Afeka's college of Engineering, where he has developed and taught the first ever academic Android Internals Course. Ron holds a Master's of Computer Science from Bar-Ilan University.More about Ron Munitz...
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]
Really good training, the instructor did a great job explaining in detail each topic and providing good examples
Very informative and up to date session, recommended for those who want to get more knowledge in Android. Looking forward for more sessions with NewCircle!!
Marko is extremely knowledgeable. Excellent class! Fantastic jump start into Android development!
the instructor Justin is very knowledgeable. He's patient in debugging every issue student faced in coding from this class.
Real-world examples were great--really enjoyed this class!
Slides were detailed and covered everything, we were provided solutions to each lab so we don't get stuck, the instructor was very knowledgable. Overall, this course is significantly better done than typical courses.
I think the training was very valuable for me and it will be very helpful to my feature work.
Excellent class on Android Internals. There were lots of topics/terms that I've heard before and now have a good understanding. This class gave me a deeper understanding of system processes that will help me debug power issues on our products.
Dave is a great instructor. He is very knowledgeable in all aspects of the android system. Highly recommend this class to anybody who wants to understand the inner workings of the android platform.
Provided a good understanding of the interaction between fundamental pieces of Android framework.
Very good course indeed. The instructor is well prepared and has a very goog expertise in Android. I would definetly recommend this course and the instructor to all my colleagues.
Justin has a natural way to make what could be a very boring class engaging. His expertise of the topic is very clear, no question was to small or to complex for him. He was happy to help everyone.
The course was very good. It covered a lot of material well. The instructor was excellent. A very good presenter, teacher, and a likable person.
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 attended the Android Internals Training in October 2014 and found the course excellent. The structure was interesting and informative and thorougly detailed. Ron is very experienced and very knowledgeble and has a good sense of humor. Material covered in the course is very vast and detail oriented but with a combination of lectures, slides and labs, it was organized and the flow was smooth. I took many tips and lots of information and definetly plan to apply to my work.
The instructor was great. He provided a lot of details on extra questions about deep internals of Android OS.
Great content and excellent presenter and tutor!
Class content: Worth every penny. Dave delivers the technical details that can accommodate beginners or savants. If you didn't double your Android knowledge after taking this class, you were sleeping.
fast pace, compressed learning.
Justin was very knowledgeable as an instructor and was very good at answering questions from students.
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.
The class was extremely thorough. I was impressed how well the instructor knew the material and had well thought out answers to every question we threw at him.
The training was extremely useful, showing Android concepts that I daily need to use in my job.
Instructor was incredibly knowledgeable. He was very patient with our questions and took the time to answer them. He was also very flexible when we wanted to change directions. I learned a TON!
The class material was detailed and the instructor very informed. Answered all our questions quoting relevant examples to better our understanding of various concepts of Android internals.
Sasa is very good at explaining Android topics and gave us an excellent overview in a short time frame.
Actually, I am now wondering to attend your 5 days training to learn more about Android application develpment.
Learned a lot in this class and peaked my interest so much that I am going to pursue Android going ahead in my career.