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.
Không gian tên androidx bao gồm các thư viện Android Jetpack. Giống như Thư viện hỗ trợ, các thư viện trong không gian tên androidx di chuyển riêng biệt từ nền tảng Android và cung cấp khả năng tương thích ngược trên các bản phát hành Android.
AndroidX là một phiên bản cải tiến lớn cho
Thư viện hỗ trợ Android ban đầu và không còn được duy trì nữa.
Các gói androidx thay thế hoàn toàn Thư viện hỗ trợ bằng cách cung cấp các tính năng ngang hàng và các thư viện mới.
Ngoài ra, AndroidX cũng bao gồm các tính năng sau:
Tất cả các gói trong AndroidX đều hoạt động trong một không gian tên nhất quán, bắt đầu bằng
chuỗi androidx. Các gói Thư viện hỗ trợ đã được liên kết vào
các gói androidx.* tương ứng. Để liên kết đầy đủ tất cả các lớp cũ
và xây dựng cấu phần phần mềm cho các lớp mới, hãy xem trang
Tái cấu trúc gói.
Không giống như Thư viện hỗ trợ, các gói androidx được duy trì và cập nhật riêng. Các gói androidx sử dụng Định nghĩa phiên bản ngữ nghĩa nghiêm ngặt, bắt đầu từ phiên bản 1.0.0. Bạn có thể cập nhật các thư viện AndroidX trong dự án của mình
một cách độc lập.
Phiên bản 28.0.0
là bản phát hành gần đây nhất của Thư viện hỗ trợ.
Sẽ không có thêm bản phát hành thư viện android.support nào nữa.
Tất cả hoạt động phát triển tính năng mới sẽ nằm trong không gian tên androidx.
Nếu muốn sử dụng thư viện không gian tên androidx trong một dự án mới,
bạn cần đặt SDK biên dịch thành Android 9.0 (API cấp độ 28) trở lên và đặt
cả hai cờ trình bổ trợ Android cho Gradle sau đây vào true trong tệp
gradle.properties của bạn.
android.useAndroidX: Khi cờ này được đặt thành true, trình bổ trợ của Android sẽ sử dụng
thư viện AndroidX thích hợp thay vì Thư viện hỗ trợ. Cờ theo mặc định là false nếu không được chỉ định.
android.enableJetifier: Khi bạn đặt cờ này thành true, trình bổ trợ của Android sẽ tự động
di chuyển các thư viện hiện có của bên thứ ba để sử dụng các phần phụ thuộc AndroidX bằng cách viết lại
các tệp nhị phân của chúng. Cờ theo mặc định là false nếu không được chỉ định.
Hãy tìm hiểu thêm về các thành phần trên trang chủ Jetpack.
Để biết thêm thông tin về việc tái cấu trúc gói từ Thư viện hỗ trợ
cho androidx,
hãy xem bài đăng trên blog
về chủ đề đó.
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-26 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-26 UTC."],[],[],null,["# AndroidX overview\n\nThe `androidx` namespace comprises the [Android Jetpack](/jetpack) libraries. Like the Support Library, libraries in the `androidx` namespace ship separately from the Android platform and provide backward compatibility across Android releases.\n\nAndroidX is a major improvement to the original Android\n[Support Library](/topic/libraries/support-library), which is no longer maintained.\n`androidx` packages fully replace the Support Library by providing feature parity and new libraries.\n\nIn addition, AndroidX includes the following features:\n\n- All packages in AndroidX live in a consistent namespace starting with the\n string `androidx`. The Support Library packages have been mapped into\n corresponding `androidx.*` packages. For a full mapping of all the old classes\n and build artifacts to the new ones, see the\n [Package Refactoring](/jetpack/androidx/refactor) page.\n\n- Unlike the Support Library, `androidx` packages are separately maintained\n and updated. The `androidx` packages use strict [Semantic Versioning](https://semver.org/),\n starting with version 1.0.0. You can update AndroidX libraries in your project\n independently.\n\n- [Version 28.0.0](/topic/libraries/support-library/revisions#28-0-0)\n is the last release of the Support Library.\n There will be no more `android.support` library releases.\n All new feature development will be in the `androidx` namespace.\n\n| **Note:** Jetpack libraries don't send any user data to a backend service of any kind. This means that integrating a Jetpack library into your app has no impact on your app's [Data safety form](/guide/topics/data/collect-share) in the Play Console.\n\nUsing `androidx` libraries in your project\n------------------------------------------\n\nSee [Migrating to AndroidX](/jetpack/androidx/migrate) to learn how to migrate an existing project.\n\nIf you want to use `androidx`-namespaced libraries in a new project,\nyou need to set the compile SDK to Android 9.0 (API level 28) or higher and set\nboth of the following Android Gradle plugin flags to `true` in your\n[`gradle.properties`](/studio/build#properties-files) file.\n\n- `android.useAndroidX`: When this flag is set to `true`, the Android plugin uses the appropriate AndroidX library instead of a Support Library. The flag is `false` by default if it is not specified.\n- `android.enableJetifier`: When this flag is set to `true`, the Android plugin automatically migrates existing third-party libraries to use AndroidX dependencies by rewriting their binaries. The flag is `false` by default if it is not specified.\n\n| **Note:** Libraries in `androidx` officially support the [Gradle](https://gradle.org/) build tool with [Android Gradle plugin](/build/releases/gradle-plugin) and don't test or maintain compatibility with any other build configuration.\n\nAPI Reference\n-------------\n\nAll the packages and classes in the `androidx` namespace can be found in the\n[AndroidX reference section](/reference/androidx/packages).\n\nAdditional Resources\n--------------------\n\nLearn more about components on the Jetpack [home page](/jetpack).\nFor more information about the package refactoring from the Support Library\nto `androidx`,\nsee [the blog post](https://android-developers.googleblog.com/2018/05/hello-world-androidx.html)\non that topic."]]