After studying this series of notes on the principles of Android Binder, entering a big factory is a "plus point"...

This note is awesome! ! !

First look at the recruitment needs of these large factories...

This note is enough to support all the "Binder principle" questions during your interview! ! !

Notes introduction

This note is a collection of ``Linux, C/S architecture, ServiceManager, ProcessState, system service registration process, ServiceManager startup
process, system service acquisition process, MediaPlayerService, JNI, Binder class registration, AMS, JavaBBinder,
etc. Technical point.

Contents:
1. Knowledge points that must be understood before learning Binder
2. Binder mechanism in ServiceManager
3. System service registration process
4. ServiceManager startup process
5. System service acquisition process
6. Java Binder initialization
7. Java Binder The registration process of the system service in

Can effectively help you connect in series and quickly deepen your in-depth understanding of Binder principles! ! !

Screenshots of some notes

1. Knowledge points that must be understood before learning Binder

1. Linux and Android IPC mechanism types
2. Linux and Binder IPC communication principle
3. Why use Binder
4. Why should I learn Binder?

Two, the Binder mechanism in ServiceManager

1. C/S architecture based on Binder communication
2. MediaServer main function
3. Unique ProcessState for each process
4. Binder mechanism in ServiceManager

Third, the registration process of system services

1. Explain how MediaPlayerService is registered
from the perspective of the call chain 2. Explain how MediaPlayerService is registered from the perspective of the process

Fourth, the startup process of ServiceManager

1. The entry function of ServiceManager
1.1 Open the binder device
1.2 Register as the context manager of the Binder mechanism
1.3 Loop waiting and processing requests from the client

Five, the process of obtaining system services

1. Client MediaPlayerService requests to obtain service
2. Server ServiceManager processes the request

6. Initialization of Java Binder

1. Java Binder JNI registration
1.1 Binder class registration
1.2 BinderInternal class registration

Seven, the registration process of the system service in Java Binder

1. Register AMS to ServiceManager
1.1 BinderInternal.getContextObject()
1.2 ServiceManagerNative.asInterface()
1.3 getIServiceManager().addService()

2. Lead JavaBBinder
3. Analyze JavaBBinder 4. Java
Binder architecture

In-depth analysis of Binder source code

As long as it is a programmer, whether it is Java or Android, if you do not read the source code and only look at the API documentation, it will just be superficial, which is not good for the establishment and completeness of our knowledge system and the improvement of actual combat technology.

The one who can really exercise the most ability is to read the source code directly, not only reading the source code of the Android system, but also including various excellent open source libraries.

Reading the source code is always the fastest way to learn.

So here is a compilation and analysis of Android development-related source code for everyone , including the source code analysis content of Binder:

The first section of the Binder series-the beginning of the
second section of the Binder Driver exploration
Section 3 Binder Driver re-exploration
Section 4 Binder start ServiceManager
Section 5 Get ServiceManager

Dachang's interview questions about Binder

The apps of first-line enterprises are multi-threaded and multi-process, while the Android inter-process communication mechanism is Binder, and the native inter-thread communication is Handler. Binder and Handler are a knowledge point that must be mastered to understand the Android operating mechanism, and it is a first-line Knowledge points must be asked in corporate interviews!

The following are the real interview questions that Dachang frequently asked about Binder:

  • What are the advantages of Binder? (Byte beating)
  • How does Binder make one copy? (Tencent)
  • Explanation of the principle of MMAP; (Tencent)
  • Why can't Intent deliver big data? (Ali)
  • Describe the details of the java classes generated by AIDL; (byte beating)
  • The communication mechanism at the bottom of the four major components; (byte beating)
  • Why can't Intent deliver big data? (Ali)
  • How does the Binder mechanism cross-process?
  • Binder mechanism principle
  • ........

Binder study notes

379 page BAT Android development interview book

After this series, I believe you will not be difficult to learn!

Well, here, the whole note is almost introduced, and interested friends can receive a wave! ! !

The above content has been included in the open source project: [ github ] , which contains self-study Android routes in different directions, interview question collection/face sutras, and series of technical articles, etc. The resources are continuously updated...

Guess you like

Origin blog.csdn.net/weixin_44339238/article/details/110233670