2023 Android Framework source code notes, open source sharing, from principle to actual combat, learn Framework

foreword

Android Framework is the current industry standard for Android development, the first framework

Due to the characteristics of the Framework, it allows developers to build various types of applications and is widely used, so it is often asked in interviews.

But I don’t know if you will encounter the following problems when learning Framework:

  • For a certain command or a certain function of the Framework layer, I just understand how to use it, and the principle behind it is not clear;
  • I especially want to understand the underlying principles and working mechanism of the Framework, but I don't know how to get started;
  • When learning a certain feature of the Framework in depth, I can't find suitable information. The information I find is a description of only a few words, or a one-sided, superficial description, and there is no description of the whole picture of a thing;
  • After starting to study the principles of the Framework in depth, I found that the knowledge blindness touched was rising sharply, and the resistance was getting bigger and bigger, so I finally gave up;
  • ……

For this reason, I collected an Android Frmaework source code note from my former Ali colleague, sorted out the Framework layer questions that are frequently asked in Internet Android job interviews, and sorted them out in a special way, and provided a detailed reference analysis. There are learning videos and supporting notes for Framework from entry to advanced to help you learn. If you need friends, you only need to support them three times. Click the portal below to get started~

The content covers: system startup process analysis, cross-process communication IPC, Handler, AMS, WMS, Surface, SurfaceFlinger, PKMS, etc. There are 10 chapters in total. At the end of the chapter, there are related interview questions to help you learn Framework better and pass the interview difficulties. .

insert image description here
Due to space reasons, only part of the content is shown in the article, and the complete content can be obtained directly by scanning the code below:

Partial excerpt

Table of contents

insert image description here

Android system startup process

Students who understand the Framework may more or less know that AMS, WMS, class loading, hotfix Sophix, plug-in, etc. all involve the system startup process.

The key processes involved from the start of the mobile phone can generally be divided into the following five steps :

  1. The mobile phone is turned on to execute the Boot ROM and the boot chip starts to execute.
  2. Load the boot program Boot Loader to RAM, and the Boot Loader is generally customized by the manufacturer.
  3. Execute the bootloader: initialize the stack, hardware, network memory and other operations.
  4. Start the Android kernel, look for init key files, and start the init process
  5. After the Kernel starts, start the init process in the user space, which is the first process in the user space, and call the main method in the init process to start the Zygote process.

It is impossible to master the specific technology only by the process. I believe that the complete source code analysis and case sharing can save everyone a lot of time.

insert image description here

Inter-process communication IPC

IPC (inter-Process-Communication) inter-process communication is used for the process of data interaction between two processes. Any operating system has an IPC mechanism, but different operating systems have different communication methods. The Android system is based on The mobile operating system of the Linux kernel, Linux's cross-process communication is mainly realized through pipelines, shared memory, memory mapping, etc., but Android has its own inter-process communication mechanism, the most representative one is Binder.

insert image description here

epilogue

Today's general environment and market are too unfriendly to Android workers, forcing everyone to show their talents. But the crisis also means opportunities. Now it is really difficult for Android programmers to find a job, but it does not mean that there are no opportunities at all. If you have a strong ability and a bright resume, why not go to the market and give yourself a possible future. Sometimes, people will lose their vitality because they freeze in place because of fear. It is better to take the risk and gamble. After all, life can only see hope when it is flowing.

Therefore, don't waste your time at any time, and keeping yourself growing is the most important thing.

Guess you like

Origin blog.csdn.net/Androiddddd/article/details/130368894