For a better reading experience, this article has been migrated to ahaoframework.tech
As an app-layer App development engineer, why should we learn Android Framework? The answer is simple: so we don't get left behind! In 2023, it seems you can't even find a job without knowing Binder WMS AMS PMS, and to make things worse, companies even expect you to know cross-platform technologies like RN Flutter, and it would be even better if you also picked up some front-end skills — a textbook case of over-engineering the interview process! For 99% of App development on the market, mastering Framework isn't actually required; companies ask about these topics purely to filter candidates, because they receive far too many resumes, and conventional questions can no longer effectively screen applicants.
For Android application development engineers who want to stay in this industry long-term, there are broadly two relatively reliable advancement paths to choose from:
- The generalist front-end path: mastering native development for both Android and iOS, cross-platform development, and front-end development
- The systems development path: mastering Linux systems development technology, becoming familiar with the principles of core Framework-layer components, and understanding the Linux kernel
The generalist front-end path largely emerged because companies aren't making as much money anymore, can't afford to hire as many people, and want one person to do the work of several — this type of position is all about cost-effectiveness.
It has to be admitted that the golden age of mobile internet has passed, and opportunities to develop large-scale Apps have almost disappeared, replaced mostly by quick, small projects. For these quick small projects, developers with 5+ years of experience have very little advantage, and from a company's perspective this can even be a drawback. Why? Senior developers command higher salaries, are less willing to work overtime, and won't buy into the "big picture" pitches bosses like to sell... By comparison, newcomers with 2-3 years of experience are more welcome — they're cheaper, more driven, and willing to work overtime. The most fatal issue is that App development — whether native, front-end, or cross-platform — changes extremely fast. Senior developers usually have families to take care of and limited energy, and their learning pace often can't keep up with newcomers. All of this together has given rise to the "age 35 problem"!
The core reason the age-35 problem exists is that the experience you've accumulated doesn't form a barrier to entry for newcomers. Simply put, your job doesn't reward experience!
Android systems development covers a very broad range of knowledge, involves a huge amount of code, has high complexity, and relevant learning materials are also quite scarce. Newcomers face a fairly high barrier to entry, which invisibly forms a moat around these positions.
From the release of Android 1.0 in 2008 to today, Android has gone through many version iterations, but the core foundational components have never changed dramatically (for example Binder, the four major app-layer components, Handler, etc.), which means the experience accumulated in systems development can build up and form a real barrier.
After all this talk, it boils down to one sentence — Framework is worth the time and effort for app developers to learn
Below is a learning roadmap for the core fundamentals of Android Framework:
A clear version of the learning roadmap can be downloaded from Link: https://pan.baidu.com/s/1F0Ibi8pHcYT39HASy3zvNw Extraction code: 1234.
The learning roadmap is divided into 11 topics in total. Let's take a look at what each of these 11 topics covers next.
Reading and learning system source code is a bit like an elementary school student reading books and newspapers. By around third grade, a student knows roughly one to two thousand characters, and with the help of a pinyin dictionary, can already read a lot of extracurricular books.
The fundamentals cover a very broad range of topics, so we should be prepared for long-term learning, take good notes along the way, and review and reinforce our memory regularly. In addition, we should learn the system source code and the fundamentals side by side — when we encounter something we don't understand, we should go back and review the fundamentals, forming a closed loop from knowledge to application. Never finish learning all the fundamentals first and only then move on to the system source code — that approach is inefficient and produces poor results.
For the fundamentals section, we mainly need to master the following content:
-
Basic use of Linux: recommended reading, "The Way of Linux Operations, 2nd Edition"
-
Programming languages
-
C language: "One-Stop Learning C Programming", "The Tao of C Language", "Self-Cultivation in Embedded C Language"
-
C++: "Learn C++ in 21 Days"
-
Java: "Core Java"
-
JNI: there's no particularly suitable book to recommend for this — follow my blog and public account, where I'll share some of my study notes later on.
-
-
Scripting languages and software build tools — the main purpose of learning this material is to understand Android's build system and to be able to write automation scripts in daily work to improve efficiency
-
Makefile: there's no particularly recommended material for this — follow my blog and public account, where I'll share some of my study notes later on.
-
Soong: for this, mainly refer to the source code implementation as well as the official documentation
-
Shell scripting, recommended reading: "Core Guide to Linux Shell Programming"
-
Python, recommended reading: "Python Programming: From Beginner to Practitioner"
-
Go, recommended reading: Go: From Beginner to Practitioner
-
-
Linux systems programming is a fairly important part
-
Linux Programming Techniques — a MOOC course provided by Xi'an University of Posts and Telecommunications, suitable for beginners
-
"Linux Systems Programming" by Jack-Benny Persson
-
"Advanced Programming in the UNIX Environment" and "The Linux/UNIX System Programming Handbook": these two books can be used as reference dictionaries while programming
-
-
Getting started with the Linux kernel and operating system fundamentals
-
Operating Systems and the Linux Kernel — a MOOC course provided by Xi'an University of Posts and Telecommunications, suitable for beginners
-
"Understanding the Linux Kernel, 3rd Edition"
-
The "Run, Linux Kernel" book series
-
Getting started with Linux driver development: the video series shared by teacher Wei Dongshan on Bilibili is recommended
-
Content already shared in the Basics section:
- Ubuntu Quick Start Guide
- Getting Started with the Make Build Tool
- Understanding Unicode, UTF-8, UTF-16, UTF-32
- Getting Started with Linux Shell Scripting — Core Fundamentals
- Quick Start Guide to Using SEAndroid
- Understanding C++ Memory Order
- Getting Started with Linux Shell Scripting Part 1 — Core Fundamentals
- Getting Started with Linux Shell Scripting Part 2 — Script Automation Basics
- How to Compile and Run C/C++ Executables on Android
- How to Read Android System Source Code — Java Edition
- How to Read Android System Source Code — C/C++ Edition
- JNI Programming Getting Started Guide: HelloWorld in Practice
- JNI Programming Getting Started Guide: JNI Data Types
- JNI Programming Getting Started Guide: Descriptors
- JNI Programming Getting Started Guide: A Detailed Look at JNIEnv
- JNI Programming Getting Started Guide: A Detailed Look at JavaVM
- JNI Programming Getting Started Guide: String Handling
- JNI Programming Getting Started Guide: Array Access
- JNI Programming Getting Started Guide: Native Accessing Java
- JNI Programming Getting Started Guide: Exception Handling
- JNI Programming Getting Started Guide: Revisiting Reference Types from a Memory Perspective
- JNI Programming Getting Started Guide: Optimizing JNI Call Performance
- JNI Programming Getting Started Guide: Multithreading
This section comes with a free companion video course
The main purpose of this section is to get you hands-on with the Android system source code and build an intuitive understanding of systems development. It mainly covers the following content:
-
Adding system modules
-
Getting started with system App development
-
Adding a Boot-Autostart C++ Program
-
A Detailed Guide to Preinstalling APKs
-
Setting Up and Using Gerrit, the System Source Code Management Tool
This section has been organized at https://github.com/yuandaimaahao/AOSPTutorial
Binder is a Remote Procedure Call (RPC) programming framework on Linux, and it's the core foundational component of the entire Android system. After experiencing the "joy" of systems development, we need to master the ins and outs of Binder as soon as possible. Planned content includes:
- Prerequisite knowledge for learning Binder
- Binder Basic Principles
- Binder Program Example - C Language Edition
- Binder Service Registration Process Analysis - C Language Edition
- Binder Service Acquisition and Usage Process Analysis - C Language Edition
- Binder Driver Scenario Analysis - ServiceManager Startup Process
- Binder Driver Scenario Analysis - Service Registration Process
- Binder Driver Scenario Analysis - Service Acquisition and Usage Process
- Binder Program Example - C++ Edition
- Binder Program Example - aidl-cpp Edition
- Binder C++ Program Analysis - Main Classes Explained
- Binder Service Registration Process Analysis - C++ Edition
- Binder Service Acquisition and Usage Process Analysis - C++ Edition
- Binder Program Example - Java Edition
- Binder Java Program Analysis - Main Classes Explained
- Binder Service Registration Process Analysis - Java Edition
- Binder Service Acquisition and Usage Process Analysis - Java Edition
- Binder Multithreading Analysis
- Binder Anonymous Service Analysis
- Binder Death Notification Mechanism
- Analysis of Difficult Binder Bugs
- Binder Interview Questions Explained
This section has been organized at https://github.com/yuandaimaahao/AndroidBinderTutorial
So-called "basic components" refers to the modules that are used extensively throughout the system source code. The content we need to learn mainly includes:
-
Smart pointers in the Android source code
-
Usage and analysis of the Android property system
-
Usage and analysis of the Android logging system
-
Permission management in Android
-
Android anonymous shared memory
-
Basic components interview questions explained
HAL mainly wraps driver functionality — it sits below the drivers and above the Framework. It mainly covers the following content:
-
Adding an Interface in the HAL Layer to Access a Linux Driver
-
Accessing the HAL Layer Interface via JNI
-
Adding a Hardware Service in the Framework to Access the Hello Driver
-
Writing an App to Access a Hardware Service
-
HwBinder Analysis, Part 1
-
HwBinder Analysis, Part 2
-
HwBinder Analysis, Part 3
-
HAL Layer Interview Questions Explained
Sometimes we may need to modify the behavior of the build system, which requires a basic understanding of the AOSP build system. Here is the suggested learning order for the build system:
-
Evolution of the AOSP Build System
-
Build System Initialization
-
Compilation Process Explained
-
Packaging Process Explained
-
Build System Interview Questions Explained
The App Framework is the component that app developers interact with most frequently. It mainly covers the following aspects:
-
AMS/ATMS and the four major components
-
Activity startup process and process startup
-
Service startup
-
ContentProvider implementation principles
-
Broadcast mechanism
-
-
Handler and Looper message handling mechanism
-
PackageManagerService workflow and principles
-
App Framework interview questions explained
System boot is a part we deal with often. Its process is shown in the diagram below:
Image from here
Main topics to become familiar with:
-
Overall system boot process
-
init process analysis
-
Zygote process analysis
-
SystemServer process analysis
-
System boot process interview questions explained
The Android graphics system is a very important subsystem within the system framework. We'll learn and understand the overall graphics system framework from the following aspects:
-
Overall graphics system framework
-
HAL layer principles analysis
-
SurfaceFlinger implementation and analysis
-
WMS implementation and analysis
-
Android View system analysis
-
VSync principles explained
-
Android graphics system interview questions explained
The input system is mainly divided into the input subsystem and IMS. We'll learn Android's input system from the following angles:
-
Overall input system framework
-
Reading events
-
Dispatching events
-
Handling events
-
Android input system interview questions explained
Most of systems development work involves developing system apps. Commonly modified system apps include:
-
Settings
-
Launcher
-
SystemUI
-
System app development interview questions explained
Once you've mastered these 11 topics, whether you go on to study other Framework modules, take part in App development, or dive into the kernel and drivers, I'm confident you'll already be well equipped to handle it with ease!
If you're interested in Framework or are currently learning it, feel free to follow my WeChat public account, where I'll continue sharing my experience to help you avoid some detours while learning. If you have questions during your studies, or experience of your own you'd like to share with everyone, feel free to add me on WeChat and I'll add you to our technical discussion group.











