1. Android Architecture
Bottom: Linux kernel (Linux kernel)--Libraries (c package to the underlying Linux kernel operations Library)--Android Runtime (Android Dalvik virtual machines and core Lib packages, calling C code to manipulate hardware via JNI)--Application framework (Google Andriod SDK)--Applications (andriod application code)
Note: Java code in Android needs to run in a Java virtual machine, while Java virtual machines invoke the underlying C code to manipulate the hardware through JNI. Java Lib operation Google package calls the underlying C code
2. The difference between a Dalvik virtual machine and a JVM virtual machine
Dalvik is based on a register, allocates multiple registers in the virtual CPU inside the virtual machine, and the JVM is stack-based, Dalvik direct access to the register, without the need to access the stack, faster
Once the JVM is compiled, a class bytecode file is generated and loaded into memory when it is used. Instead, Dalvik compiles all class files into a Dex file, which contains all the classes. When the compiler compiles the Java file into a class file, the Dalvik virtual machine re-compiles the class file into a Dex bytecode file and deletes the class file. A constant pool holds constant information from all classes. This reduces the number of file I/O operations, the speed of the submission of class queries, the introduction of a constant pool and other concepts, improve query speed, more efficient execution
Dalvik supports running multiple virtual machine instances in limited memory, and each Dalvik virtual machine application is handled as a standalone Linux process, preventing all programs from shutting down in the case of a virtual machine crash
video-no.01 Android Basic Video tutorial