Android Architecture
The Android operating system is a stack of software components, which can be broadly divided into five parts and four main layers in the architecture diagram.
Linux Kernel
At the bottom of all layers is the Linux kernel, including approximately 115 patches for Linux 3.6. It provides basic system functionalities such as process management, memory management, and device management (e.g., camera, keyboard, display). Additionally, the kernel handles all the tasks that Linux is good at, such as networking and a large number of device drivers, thus avoiding the inconvenience of compatibility with a vast array of peripheral hardware interfaces.
Libraries
Above the Linux kernel layer is a collection of libraries, including the open-source Web browser engine WebKit, the well-known libc library, the SQLite database for storage and application data sharing, libraries for playing and recording audio and video, and the SSL library for network security, among others.
Android Libraries
This category includes libraries developed specifically for Android using Java. Examples of these libraries include application framework libraries, such as user interface construction, graphics rendering, and database access. Some of the core Android libraries available to Android developers are summarized as follows:
- android.app - Provides access to the application model and is the foundation of all Android applications.
- android.content - Facilitates content access, publishing, and messaging between applications and application components.
- android.database - Used to access data published by content providers, including SQLite database management classes.
- android.opengl - The Java interface for the OpenGL ES 3D graphics rendering API.
- android.os - Provides applications with access to standard operating system services, including messages, system services, and inter-process communication.
- android.text - Renders and manipulates text on device displays.
- android.view - The fundamental building blocks of the application user interface.
- android.widget - A rich set of pre-built user interface components, including buttons, labels, lists, layout managers, radio buttons, and more.
- android.webkit - A collection of classes that allow built-in Web browsing capabilities for applications.
Having reviewed the Java-based core libraries within the Android runtime layer, it's time to focus on the C/C++-based libraries in the Android software stack.
Android Runtime
This is the third part of the architecture, the second layer from the bottom up. This section provides the key component known as the Dalvik Virtual Machine, similar to the Java Virtual Machine but specifically designed and optimized for Android.
The Dalvik Virtual Machine allows the use of Linux kernel functionalities, such as memory management and multithreading, in Java. The Dalvik Virtual Machine ensures that each Android application runs in its own separate virtual machine process.
The Android Runtime also provides a set of core libraries to enable Android application developers to write Android applications using the standard Java language.
Application Framework
The Application Framework layer provides many high-level services to applications in the form of Java classes. Application developers are allowed to use these services in their applications.
- Activity Manager - Controls all aspects of the application lifecycle and activity stack.
- Content Providers - Allow applications to publish and share data.
- Resource Manager - Provides access to non-code embedded resources, such as strings, color settings, and user interface layouts.
- Notification Manager - Allows applications to display dialogs or notifications to users.
- View System - An extensible set of views for creating application user interfaces.
Applications
At the top layer are all the Android applications. The applications you write will also be installed at this layer. These applications include contacts, browser, games, and more.