Android Process One
1. Review the structure
Engine base class
-abstract operation () interface interface
Tire sub-Class
-operation ()
2. Process
class, module, app executes in an area of memory, there is a gap between each block, the principle cannot call each other
There are certain ways to access each other, so cross-process communication is called inter-process communication
In general, the components of an Android application are in the same process, which is called short-range communication
3. IPC
When you start the app, the Android system's Zygote service fork a new process
The address space of the different processes is independent and the communication is relatively slow
4. Android Process
There is a virtual machine VM object in the Android process that executes Java code and also directs the execution of the JNI local program, enabling communication between Java and C + +
Each process has: A VM object, the main thread, and the MQ used by the main thread, Looper
:
---Progress---------------------
|
|java
|
|------------JNI-------------VMS
|
|c/c++
|
|-------------------------------
The meaning of Looper is to keep the main thread running.
The most important task of the main thread is to handle UI events, and whenever a UI event occurs, the Android framework adds a message to MQ, the main thread executes a specific method based on the message, executes the Looper class, and observes the MQ dynamic
Android Process One