Hike Messenger 利用 Android 架構元件提升速度和簡單性
透過集合功能整理內容
你可以依據偏好儲存及分類內容。

Hike 於 2012 年推出產品,旨在簡化網際網路環境的導入程序。Hike 結合即時通訊、訊息和動態饋給,以及與第三方交通運輸和付款應用程式的整合功能。開發這些功能在不同時間的發展非常迅速,因此這間公司稱為「重大技術與架構負債」。因為債務將成為穩定性、可維護性和效能的瓶頸,因此該公司想要快速簡化程式碼。
具體措施
健行技術後,他轉為使用 Android 架構元件,也就是「我們的瑞士軍刀處理所有這些挑戰」。CTO Vishwanath Ramarao 表示。開始使用 ViewModel,資料在設定變更 (例如螢幕旋轉) 後仍持續有效;LiveData、可觀測的資料容器類別,以及 Room 持續性程式庫。Ramarao 補充:「我們是現代化的回應式應用程式,Room 和 LiveData 確實與前瞻性的設計原則息息相關。
Hike 也正在評估分頁程式庫,這可讓應用程式更輕鬆地從資料來源視需要逐步載入資訊,而不會造成裝置超載,也不必等候大型資料庫查詢過長。
「我們大致瞭解了架構元件,現在想瞭解詳情。」
Ramarao 說道。「不過,我們開始探索 Android 生態系統的最佳做法後,
是處理技術和架構債務的重要工具。最終成為翻新架構和開發做法的一種方式。」
成果
採用架構元件後,Hike 可大幅減少應用程式的程式碼總數,同時讓程式碼更易於閱讀及維護。此外,Android 架構元件也幫助他們將不受當機影響的使用者評分提高至 99% 以上,過去曾難以達成這些評分。
開始使用
Android 架構元件開放所有開發人員使用,這是 Android Jetpack 的一部分。開始使用 Android 架構元件。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2018-05-03 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2018-05-03 (世界標準時間)。"],[],[],null,["# Hike Messenger gains speed and simplicity with Android Architecture Components\n\nLaunched in 2012, Hike is building products with the aim of simplifying the\ninternet to bring India online. Hike combines chat, messaging, feeds,\nand integrations with third-party transportation and payment apps.\nIt developed these features very rapidly and at different points in\ntime, resulting in what the company called \"significant technical and\narchitectural debt.\" Because this debt was becoming a bottleneck to\nstability, maintainability and performance, the company wanted to simplify\nits code quickly.\n\nWhat they did\n-------------\n\nHike turned to [Android Architecture Components](/jetpack/arch), which\nbecame \"our Swiss army knife to tackle all of these challenges\" says\nCTO Vishwanath Ramarao. It began using\n[ViewModel](/topic/libraries/architecture/viewmodel), which allows data to\nsurvive configuration changes (such as screen rotations);\n[LiveData](/topic/libraries/architecture/livedata), an\nobservable data-holder class; and the\n[Room](/topic/libraries/architecture/room) persistence library.\n\"We're a modern, reactive app, and Room and LiveData fit really\nwell with our forward-design principles\" Ramarao adds.\n\nHike is also evaluating the [Paging Library](/topic/libraries/paging),\nwhich makes it easier for an app gradually to load information as needed from a\ndata source, without overloading the device or waiting too long for a big\ndatabase query.\n\u003e \"We were aware of Architecture Components in general and wanted to learn more\"\n\u003e Ramarao says. \"But what started as an exploration of the Android-ecosystem\n\u003e best practices became an important tool to tackle our technical and\n\u003e architectural debt. It ultimately became a way of modernizing our\n\u003e architecture and development practice\".\n\nResults\n-------\n\nThanks to Architecture Components, Hike significantly reduced the total\nlines of code in their app, while also making that code more readable\nand maintainable. Android Architecture Components also helped them to\nraise their crash-free user ratings to well beyond 99 percent,\nsomething they'd struggled to accomplish in the past.\n\nGet started\n-----------\n\nAndroid Architecture Components is open to all developers as part of\n[Android Jetpack](/jetpack). [Get\nstarted with Android Architecture Components](/jetpack/arch)."]]