Introduction
This project is a learning type project, mainly to learn some of the latest ideas and development ideas of Android. The project is developed according to the development ideas of modularization and componentization. The overall structure of the project is as follows.
The project code is clean and standardized, with a clear structure, using the latest Android development ideas and technologies, and integrating React-Native cross-platform, mainly for the purpose of experimenting with hot update functions. The technologies involved are as follows:
- Developed using kotlin language, the project uses modular development, which reduces coupling;
- The network uses the retrofit2 + okhttp3 method, which is highly encapsulated;
- leakcanary memory leak detection
- Mavericks based on MVI architecture airbnb
- local mock
- alibaba ARouter
- Integrated RN hot update function, the user needs to open the rn loading page, please refer to the rn project
experience
- Apk Download Link: Apk Download Link
Apk QR code
Some of the effects are as follows:
MVI Architecture
With no clear standard for state management, view rendering and business logic can get a bit messy as the app grows or features are added or not planned in advance, and this often happens during Android app development. Maybe you often encounter state management that leads to unclear division of labor between business logic and UI rendering, and ultimately leads to confusion in the application architecture. The newly proposed MVI architecture advocates a design idea of one-way data flow, which is very suitable for data-driven UI display projects. The architectural idea of MVI comes from the front end, which is composed of three parts: Model, View and Intent.
- Model: Different from the Model in other MVVM, the Model of MVI mainly refers to the UI state (State). The content displayed on the current interface is nothing more than a snapshot of the UI state: for example, the data loading process, the location of controls, etc. are all UI states
- View: Consistent with other Views in MVX, it may be an Activity, Fragment or any UI bearing unit. View in MVI achieves interface refresh by subscribing to changes in Intent (not Activity's Intent, which will be introduced later)
- Intent: This Intent is not an Activity's Intent. Any operation of the user is packaged as an Intent and sent to the Model for data request
Third-party libraries used
library | Function |
---|---|
retrofit2 | network |
okHttp3 | network |
mavericks | MVI framework |
BaseRecyclerViewAdapterHelper | Universal Adapter |
PhotoView | Picture Preview |
ARouter | componentized routing |
coil | image loading |
XPopup | popup component |
banner | scroll map |
SmartRefreshLayout | Smart pull-to-refresh framework |
gson | json parsing |
leakcanary | Memory leak detection library |
Attachment: https://github.com/GuoguoDad/jd_mall
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。