谷歌官文文檔地址:https://developer.android.google.cn/topic/libraries/architecture android
安卓構架組建是庫的集合:幫助你設計健壯的、易測試的、可維護的應用。使用類做爲入口管理UI組建的生命週期和處理數據持久化。 app
Android architecture components are a collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence. ide
- 瞭解將健壯的應用放在一塊兒的基礎知識請看應用構架指南。Learn the basics of putting together a robust app with theGuide to app architecture.
- 管理應用的生命週期。新的生命週期感知組建技術幫助管理Activity和fragment的生命週期。保持設置的改變、避免內存泄漏而且更容易的將數據載入UI。Manage your app's lifecycle. New lifecycle-aware componentshelp you manage your activity and fragment lifecycles. Survive configuration changes, avoid memory leaks and easily load data into your UI.
- 使用LiveData建立數據對象,這樣底層數據更改時會通知用戶界面。 Use LiveData to build data objects that notify views when the underlying database changes.
- ViewModel用於保存和用戶界面香港的數據,這樣界面旋轉時相關的數據不會被丟失。 ViewModel stores UI-related data that isn't destroyed on app rotations.
- Room是一個SQLite對象映射庫。使用它來避免樣板代碼,並輕鬆地將SQLite表數據轉換爲Java對象。 Room提供了SQLite語句的編譯時檢查,而且能夠返回RxJava,Flowable和LiveData可觀察對象。 Room is a SQLite object mapping library. Use it to avoid boilerplate code and easily convert SQLite table data to Java objects. Room provides compile time checks of SQLite statements and can return RxJava, Flowable and LiveData observables.