自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
AppSearch
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
AppSearch 是裝置端索引和結構化搜尋引擎,已在 Android 12 中以 APEX 的形式發布。在 Android 13 中,AppSearch 會以 Mainline 模組的形式提供。
動機
為確保在 Android 生態系統中一致實作 AppSearch,並支援更新功能。
優點:
- 允許透過 Play 商店更新 AppSearch
- 確保符合 AppSearch CDD 規定
詳細說明
- 透過 AppSearch API 收集的資料會保留在使用者的裝置上 (匯總指標資料除外,這類資料是用於效能最佳化)。
- 快速的行動優先儲存空間實作方式,可降低 I/O 用量
- 針對大型資料集提供高效率的索引和查詢
- 支援多種語言,例如英文、西班牙文和中文 (臺灣)
- 關聯性排名和使用分數
AppSearch 架構
圖 1 強調 AppSearch 概念和系統服務程序邊界。
圖 1. AppSearch 模組架構
模組邊界
請參閱圖 1 中的模組架構圖。
這個模組的主要功能已納入 APEX 套件 com.android.appsearch
。
依附元件
- libicu
- libprotobuf-cpp-lite
- ndk
自訂
這個模組無法自訂。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# AppSearch, an on-device indexing and structured search engine, was shipped as\nan APEX in Android 12. In Android\n13, AppSearch is shipped as a Mainline module.\n\nMotivation\n----------\n\nTo ensure a consistent implementation of AppSearch across the Android ecosystem\nand support updateability.\n\nBenefits:\n\n- Allow updating AppSearch via Play Store\n- Ensure compliance with the AppSearch CDD requirements\n\nDetails\n-------\n\n- Data collected through AppSearch APIs remains on the user's device (except aggregated metrics data, which is used for performance optimization purposes).\n- A fast, mobile-first storage implementation with low I/O use\n- Highly efficient indexing and querying over large data sets\n- Multi-language support, such as English, Spanish and CJKT\n- Relevance ranking and usage scoring\n\nAppSearch architecture\n----------------------\n\nFigure 1 highlights AppSearch concepts as well as the system service\nprocess boundary.\n\n**Figure 1.** AppSearch module architecture\n\nModule boundary\n---------------\n\n- AppSearch Mainline Apex - `com.android.appsearch`\n\n - AppSearch API surface (Java)\n - Code Location: `frameworks/base/apex/appsearch/framework`\n - Process: \u003cvar translate=\"no\"\u003eBOOT_CLASS_PATH\u003c/var\u003e\n - AppSearchManagerService (Java)\n - Code Location: `frameworks/base/apex/appsearch/service`\n - Process: system_server\n - Icing Native library (C++)\n - Code Location: `external/icing`\n - Process: system_server\n- HAL Interface/Implementations (C++)\n\n - N/A\n\nRefer to the module architecture diagram in Figure 1.\n\nPackage format\n--------------\n\nThe main functions of this module are included in the APEX package\n`com.android.appsearch`.\n\nDependencies\n------------\n\n- libicu\n- libprotobuf-cpp-lite\n- ndk\n\nCustomization\n-------------\n\nThis module is not customizable."]]