Android System Architecture

Source: Internet
Author: User
Tags java se

First look at the picture:

  The above figure shows the diagram of Android Architecture. The Android OS can be referred to as a software stack of different layers, where each layer was a group of Sveral program Components. Together It includes operating system, middleware and important applications. Each of the layer in the architecture provides different services to the layer just above it. We'll examine the features of each layer in detail.

Above is the Android OS architecture diagram. The Android operating system consists of four layers, each of which includes some program modules. Overall includes: Operating system, middle tier and important applications, each layer encapsulates the underlying implementation and exposes the calling interface to the previous layer.

Linux Kernel

The basic layer is the Linux kernel.  The whole Android OS is built on top of the Linux 2.6 Kernel with some further architectural changes made by Google. It's this Linux that interacts with the hardware and contains all the essential hardware drivers. Drivers is programs that control and communicate with the hardware. For example, consider the Bluetooth function. All devices have a Bluetooth hardware in it.  Therefore The kernel must include a Bluetooth driver to communicate with the Bluetooth hardware. The Linux kernel also acts as an abstraction layer between the hardware and other software layers. Android uses the Linux for all its core functionality such as Memory management, process management, networking, security Settings etc. As the android is built in a most popular and proven foundation, it made the porting of Android to variety of hardware, a Relatively painless task

Libraries

The next layer is the Android ' s native libraries. It's this layer, that enables, the device to handle different types of data. These libraries is written in C, or C + + language and is specific for a particular hardware.

Some of the important native libraries include the following:

Surface Manager: It is used for compositing Windows manager with off-screen buffering. Off-screen buffering means you cant directly draw into the screens, but your drawings go to the off-screen buffer. There it is combined with other drawings and form the final screen the user would see. This off screen buffer is the reason behind the transparency of Windows.

Media Framework: Media Framework provides different media codecs allowing the recording and playback of different media formats

SQLite: SQLite is the database engine used on Android for data storage purposes

WebKit: It's the browser engine used to display HTML content

OpenGL: Used to render 2D or 3D graphics content to the screen

Android Runtime

Android Runtime consists of Dalvik Virtual machine and Core Java libraries.

Dalvik Virtual Machine

It is a type of JVM used on Android devices to run apps and are optimized for low processing power and low memory Environme Nts. Unlike the JVM, the Dalvik Virtual machine doesn ' t run. class files, instead it runs. dex files. . dex files is built from. class file at the time of compilation and provides Hifger efficiency in low resource environmen Ts. The Dalvik VM allows multiple instance of Virtual machine to be created simultaneously providing security, isolation, Memo RY Management and threading support. It's developed by Dan Bornstein of Google.

Core Java Libraries
These is different from Java SE and Java ME libraries. However these libraries provides most of the functionalities defined in the Java SE libraries.

Application Framework

These is the blocks that we applications directly interacts with. These programs manage the basic functions of the phone like resource management, voice call management etc. As a developer, you just consider these is some basic tools with which we is building our applications.

Important blocks of application framework is:

Activity Manager: Manages the activity life cycle of applications

Content Providers: Manage the data sharing between applications

Telephony Manager: Manages all voice calls. We use the Telephony manager if we want to access voice calls in our application.

Location Manager: Location management, using GPS or cell tower

Resource Manager: Manage the various types of resources we use with our application

Applications

Applications is the top layer in the Android architecture and this is where we applications is gonna fit. Several standard applications comes pre-installed with every device, such as:

    • SMS Client App
    • Dialer
    • Web Browser
    • Contact Manager

As a developer we is able to write the app which replace any existing system app. That's, you were not limited in accessing any particular feature. You is practically limitless and can whatever you want to does with the Android (as long as the users of your app permits I T). Thus Android is opening endless opportunities to the developer.

Linux kernel (Linux Kernel)

Android runs on Linux kernel 2.6, but replaces the Linux-bound part of the GNU protocol so that Android programs can be used for commercial purposes. the Linux kernel is the abstraction layer between the hardware and software layers.

Middleware
Middleware includes two parts: Core library and runtime (libraries & Android Runtime)

(1) The core library includes the Surfacemanager Display System Management Library, which is responsible for displaying 2D or 3D content to the screen; Media Framework Library, responsible for supporting images, supporting the recording and playback of multiple video and audio; SQlite database, A powerful lightweight embedded relational database, WebKit browser engine, etc.


(2) Dalvik virtual machine: Different from Java Virtual machine, every Android application runs in its own process, there is a own Dalvik virtual machine, this can make the system can be optimized at runtime, the impact of the program is greatly reduced. Instead of running Java bytecode, the Dalvik virtual machine runs its own bytecode.

Application Framework (Application framework)
A rich and extensible view (views) that can be used to build applications, including lists (lists), grids (grids), TextBox (text boxes), buttons (buttons), and web browsers that can be embedded.
Content Providers enables an application to access data from another application, such as a contact database, or to share its own data.
The Resource Manager (Resource Manager) provides access to non-code resources, such as local strings, graphics, and layout files (layoutfiles).
The Notification Manager (Notification Manager) enables applications to display customized prompts in the status bar.
Activity Manager is used to manage the application lifecycle and to provide common navigation fallback functionality.

Applications (applications)
Android system will include some application packages including email client, SMS short message program, calendar, map, browser, contact management program and so on. All applications are written in the Java language.

Reproduced from source documents:

Http://www.android-app-market.com/android-project-structure.html

Http://android.yaohuiji.com/archives/53

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.