Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release thay vì aosp-main để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Dự án nguồn mở Android (AOSP) là mã nguồn Android có thể sửa đổi và được cung cấp công khai. Bất kỳ ai cũng có thể tải xuống và sửa đổi AOSP cho thiết bị của mình. AOSP cung cấp một quy trình triển khai hoàn chỉnh và đầy đủ chức năng của nền tảng di động Android.
Sau đây là danh sách định nghĩa cho các thuật ngữ được dùng trong Hình 1:
Ứng dụng Android
Một ứng dụng chỉ được tạo bằng Android API. Cửa hàng Google Play được sử dụng rộng rãi để tìm và tải các ứng dụng Android xuống, mặc dù có nhiều lựa chọn thay thế khác. Trong một số trường hợp, nhà sản xuất thiết bị có thể muốn cài đặt sẵn một ứng dụng Android để hỗ trợ chức năng cốt lõi của thiết bị. Nếu bạn quan tâm đến việc phát triển ứng dụng Android, hãy tham khảo developers.android.com.
Ứng dụng có đặc quyền
Một ứng dụng được tạo bằng cách kết hợp API Android và API hệ thống. Bạn phải cài đặt trước các ứng dụng này dưới dạng ứng dụng đặc quyền trên thiết bị.
Ứng dụng của nhà sản xuất thiết bị
Một ứng dụng được tạo bằng cách kết hợp API Android, API hệ thống và quyền truy cập trực tiếp vào quá trình triển khai khung Android. Vì nhà sản xuất thiết bị có thể truy cập trực tiếp vào các API không ổn định trong khung Android, nên các ứng dụng này phải được cài đặt sẵn trên thiết bị và chỉ có thể cập nhật khi phần mềm hệ thống của thiết bị được cập nhật.
System API
System API là API Android chỉ dành cho các đối tác và OEM để đưa vào các ứng dụng đi kèm. Các API này được đánh dấu là @SystemApi trong mã nguồn.
API Android
Android API là API công khai dành cho nhà phát triển ứng dụng Android bên thứ ba. Để biết thông tin về Android API, hãy tham khảo Tài liệu tham khảo Android API.
Khung Android
Một nhóm các lớp, giao diện Java và mã được biên dịch sẵn khác mà các ứng dụng được xây dựng dựa trên đó. Một số phần của khung này có thể truy cập công khai thông qua việc sử dụng Android API. Các phần khác của khung chỉ được cung cấp cho OEM thông qua việc sử dụng API hệ thống. Mã khung Android chạy trong quy trình của một ứng dụng.
Dịch vụ hệ thống
Dịch vụ hệ thống là các thành phần theo mô-đun, tập trung như system_server, SurfaceFlinger và MediaService. Chức năng do API khung Android cung cấp sẽ giao tiếp với các dịch vụ hệ thống để truy cập vào phần cứng cơ bản.
Thời gian chạy Android (ART)
Môi trường thời gian chạy Java do AOSP cung cấp. ART thực hiện việc dịch mã byte của ứng dụng thành các chỉ dẫn dành riêng cho bộ xử lý do môi trường thời gian chạy của thiết bị thực thi.
Lớp trừu tượng phần cứng (HAL)
HAL là một lớp trừu tượng có giao diện tiêu chuẩn để các nhà cung cấp phần cứng triển khai. HAL cho phép Android không phụ thuộc vào các cách triển khai trình điều khiển cấp thấp. Việc sử dụng HAL cho phép bạn triển khai chức năng mà không ảnh hưởng hoặc sửa đổi hệ thống cấp cao hơn. Để biết thêm thông tin, hãy xem bài viết Tổng quan về HAL.
Thư viện và chương trình nền gốc
Các chương trình nền gốc trong lớp này bao gồm init, healthd, logd và storaged. Các chương trình này tương tác trực tiếp với nhân hoặc các giao diện khác và không phụ thuộc vào việc triển khai HAL dựa trên không gian người dùng.
Các thư viện gốc trong lớp này bao gồm libc, liblog, libutils, libbinder và libselinux. Các thư viện gốc này tương tác trực tiếp với nhân hoặc các giao diện khác và không phụ thuộc vào việc triển khai HAL dựa trên không gian người dùng.
Kernel
Nhân là phần trung tâm của mọi hệ điều hành và giao tiếp với phần cứng cơ bản trên thiết bị. Nếu có thể, nhân AOSP sẽ được chia thành các mô-đun độc lập với phần cứng và các mô-đun dành riêng cho nhà cung cấp. Để biết nội dung mô tả, bao gồm cả định nghĩa về các thành phần của nhân AOSP, hãy tham khảo bài viết Tổng quan về nhân.
Tiếp theo là gì?
Nếu bạn mới sử dụng AOSP và muốn bắt đầu phát triển, hãy tham khảo phần Bắt đầu.
Nếu bạn muốn tìm hiểu thêm về một lớp cụ thể của AOSP, hãy nhấp vào tên của phần đó trong trình đơn điều hướng bên trái và bắt đầu bằng thông tin tổng quan về phần đó.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-24 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-24 UTC."],[],[],null,["# Architecture overview\n\nThe *Android Open Source Project (AOSP)* is publicly available and modifiable\nAndroid source code. Anyone can download and modify AOSP for their device. AOSP\nprovides a complete and fully functional implementation of the Android mobile\nplatform.\n| **Note:** AOSP can't provide support for apps that require backend services, such as a cloud messaging or advanced location services app. AOSP also doesn't include a full set of end-user apps that might be needed for particular types of devices.\n\nThere are two levels of compatibility for devices implementing AOSP: AOSP\ncompatibility and Android compatibility. An *AOSP-compatible device* must\nconform to the list of requirements in the\n[Compatibility Definition Document (CDD)](/docs/compatibility/cdd). An\n*Android-compatible device* must conform to the list of requirements in the CDD\nand Vendor Software Requirements (VSR) and tests such as those in the\n[Vendor Test Suite (VTS)](/docs/core/tests/vts) and\n[Compatibility Test Suite (CTS)](/docs/compatibility/cts). For further\ninformation on Android compatibility, refer to the\n[Android compatibility program](/docs/compatibility).\n\nAOSP architecture\n-----------------\n\nThe software stack for AOSP contains the following layers:\n\n**Figure 1.** AOSP software stack architecture.\n\nFollowing is a list of definitions for terms used in Figure 1:\n\n*Android app*\n: An app created solely using the Android API. Google\n Play Store is widely used to find and download Android apps, though there are\n many other alternatives. In some cases, a device manufacturer might want to\n preinstall an Android app to support the core functionality of the device. If\n you're interested in developing Android apps, refer to\n [developers.android.com](https://developer.android.com/).\n\n*Privileged app*\n: An app created using a combination of the Android and system APIs. These apps\n must be preinstalled as privileged apps on a device.\n\n*Device manufacturer app*\n: An app created using a combination of the Android API, system API, and direct\n access to the Android framework implementation. Because a device manufacturer\n might directly access unstable APIs within the Android framework, these apps\n must be preinstalled on the device and can be updated only when the device's\n system software is updated.\n\n*System API*\n: The System API represents Android APIs available only to partners and\n OEMs for inclusion in bundled applications. These APIs are marked as @SystemApi\n in the source code.\n\n*Android API*\n: The Android API is the publicly available API for third-party Android app\n developers. For information on the Android API, refer to\n [Android API reference](https://developer.android.com/reference).\n\n*Android framework*\n: A group of Java classes, interfaces, and other precompiled code upon which\n apps are built. Portions of the framework are publicly accessible through the\n use of the Android API. Other portions of the framework are\n available only to OEMs through the use of the system APIs. Android\n framework code runs inside an app's process.\n\n*System services*\n: System services are modular, focused components such as `system_server`,\n SurfaceFlinger, and MediaService. Functionality exposed by Android framework API\n communicates with system services to access the underlying hardware.\n\n*Android runtime (ART)*\n: A Java runtime environment provided by AOSP. ART performs the\n translation of the app's bytecode into processor-specific instructions\n that are executed by the device's runtime environment.\n\n*Hardware abstraction layer (HAL)*\n: A HAL is an abstraction layer with a standard interface for hardware vendors\n to implement. HALs allow Android to be agnostic about lower-level driver\n implementations. Using a HAL lets you implement functionality without\n affecting or modifying the higher level system. For further information,\n see the [HAL overview](/docs/core/architecture/hal).\n\n*Native daemons and libraries*\n\n: Native daemons in this layer include `init`, `healthd`, `logd`, and\n `storaged`. These daemons interact directly with the kernel or other interfaces\n and don't depend on a userspace-based HAL implementation.\n\n Native libraries in this layer include `libc`, `liblog`, `libutils`,\n `libbinder`, and `libselinux`. These Native libraries interact directly with\n the kernel or other interfaces and don't depend on a userspace-based HAL\n implementation.\n\n*Kernel*\n\n: The kernel is the central part of any operating system and talks to the\n underlying hardware on a device. Where possible, the AOSP kernel is split\n into hardware-agnostic modules and vendor-specific modules. For a description,\n including definitions, of AOSP kernel components, refer to the\n [Kernel overview](/docs/core/architecture/kernel).\n\nWhat's next?\n------------\n\n- If you're new to AOSP, and want to get started with development, refer to the [Get started section](/docs/setup).\n- If you want to learn more about a specific layer of AOSP, click the section's name in the left navigation and begin with the overview for that section."]]