Introduction to Android Architecture

Source: Internet
Author: User

Android is essentially adding Java Virtual machine Dalvik on a standard Linux system and building a Java application framework on the Dalvik virtual machine. All applications are based on the Java application framework.
Android is mainly applied to arm platforms, but not only arm, but also through the compiler control, on the X86, Mac and other architectures of the machine can be run.

Android is divided into four tiers, from the high-level to the lower tier, which are application tiers, application framework tiers, System runtime tiers, and Linux core tiers.
The blue represents the Java program, the yellow code is the virtual machine that runs the Java program, the green part is the library written in the C + + language, the Red Code kernel (Linux kernel +driver). Under the application framework, it is composed of a C + + library that completes calls from Java to C via JNI.

1)   application

Leveraging the cross-platform nature of Java, Android-based applications can run on any Android-installed platform without compiling This is the essence of Android.

2)   application framework

hidden behind each app is a series of services and systems, including;

 b. Content Providers allows an application to access data from another application, such as a contact database. or share their own data.
 c. Resource Manager (Resource Manager) provides access to non-code resources such as local strings, graphs, and layout files files).
 d. The Notification Manager (Notification Manager) enables applications to display customized prompts in the status bar.
 e. Activity Manager is used to manage the application lifecycle and provide common navigation fallback functionality.

3) System Runtime Library
a) Program library
Android contains a number of C + + libraries that can be used by different components of the Android system. They provide services to developers through the Android application framework.
here are some core libraries:
mainly includes basic C library, and multimedia library to support various multimedia formats, bitmap and vector fonts, 2D and 3D graphics engine, browser, database support.
1.Bionic System C library.
2. Media Library, based on PacketVideo Opencore.
the 3.Surface Manager, as its name implies, is used to manage Surface.
4.webkit,libwebcore Browser, based on Webkit engine.
5.SGL bottom 2D graphics engine
6.3D Libraries based on OpenGL ES 1.0 APIs
7.FreeType Bitmap (bitmap) and vector font display.
8.SQLite a lightweight relational database engine that is available and powerful for all applications.
 
also there is a hardware abstraction layer. In fact, Android not all device drivers are placed in the Linux kernel, a part of the implementation in the user space,
The main reason for this is to avoid the GPL that Linux adheres to, and generally, if you want to port Android to other hardware to run,
you just need to implement this part of the code. Includes: Monitor driver, sound, camera, gps,gsm and so on.
 
b) Android Runtime Library
Android includes a core library that provides most of the functionality of the Java programming language core library.
each Android application runs in its own process and has a separate instance of the Dalvik virtual machine.
Dalvik is designed as a device that can run multiple virtual systems at the same time and efficiently.
Dalvik virtual Machine Execution (. dex) Dalvik executable, which is optimized for small memory usage.
while the virtual machine is a register-based, all classes are compiled by the Java compiler and then converted to. dex format by the "DX" tool in the SDK to be executed by the virtual machine.
Dalvik virtual machines rely on some of the features of the Linux kernel, such as threading mechanisms and underlying memory management mechanisms.
  
4) Linux kernel
Android's core system services rely on the Linux 2.6 kernel, such as security, memory management, process management, network protocol stacks, and drive models.
the Linux kernel also acts as an abstraction layer between the hardware and the software stack. In addition, it has been partially modified, mainly involving two parts:
a) Binder
(IPC): Provides effective inter-process communication, although the Linux kernel itself has provided these features, but many of the Android system services need this feature for some reason
it has achieved its own set of.
b) Power Management: Save energy for handheld devices.

Finally talking about the language used by Android, its application development in the Java language, we say that Java generally contains three parts:
A) Java language: that is, its syntax, its code-writing program
b) Java Virtual machine: In order to implement the principle that the compilation can run everywhere, Java does not produce the target machine language after compiling the connection, but uses the Java bytecode
This java common instruction requires a virtual machine to perform the change instruction.
c) Library: As with our usual C language, we provide some common libraries.
The latter combination is Java Runtime environment.

Introduction to Android Architecture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.