All Projects → jeanboydev → Android Architecture

jeanboydev / Android Architecture

Licence: apache-2.0
🌇该项目结合 MVP 与 Clean 架构思想,探索在 Android 项目上的最佳实践。

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Android Architecture

Viabus Architecture
让 Android 开发可以像流水线一样高效的,职责分离架构 ⚡ 不同于 MVP 的配置解耦,也不能和 似是而非 的 MVVM - Clean 同日而语。VIABUS 是世界范围内首个明确提出,通过职责分离,来真正实现 UI 和 业务并行开发的 Android 项目级开发架构和设计模式理念。
Stars: ✭ 485 (+333.04%)
Mutual labels:  rxjava, architecture, mvp, android-architecture
Android Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture using Dagger2, GreenDao, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 4,360 (+3792.86%)
Mutual labels:  rxjava, mvp, android-architecture, dagger
Mvparms
⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架).
Stars: ✭ 10,146 (+8958.93%)
Mutual labels:  rxjava, architecture, mvp, android-architecture
Android Base Mvp
Android Base MVP Concept with RXJava, Dagger, Event Bus, Retrofit, Glide, OkHTTP
Stars: ✭ 141 (+25.89%)
Mutual labels:  rxjava, architecture, mvp, dagger
Firebucket
Glimpse into Firebase, with a simple TODO list app built around Dagger, RxJava 2, Clean architecture and of course, Firebase.
Stars: ✭ 376 (+235.71%)
Mutual labels:  rxjava, mvp, dagger
UTair-MVP-Sample
Android Clean Architecture + MVP Sample written in Kotlin
Stars: ✭ 27 (-75.89%)
Mutual labels:  mvp, dagger, android-architecture
Alfonz
Mr. Alfonz is here to help you build your Android app, make the development process easier and avoid boilerplate code.
Stars: ✭ 90 (-19.64%)
Mutual labels:  rxjava, architecture, android-architecture
AndroidMVPArchitecture
Android MVP architecture sample project with or without RxJava and Dagger2 and Kotlin
Stars: ✭ 78 (-30.36%)
Mutual labels:  rxjava, mvp, dagger
Mvpart
🎨 A new Android MVP architecture (此框架旨在解决传统 MVP 类和接口太多, 并且 Presenter 和 View 通过接口通信过于繁琐, 重用 Presenter 代价太大等问题).
Stars: ✭ 776 (+592.86%)
Mutual labels:  architecture, mvp, android-architecture
Android Mvp Starter
Create/Generate your MVP projects easily
Stars: ✭ 72 (-35.71%)
Mutual labels:  rxjava, mvp, dagger
Mvvm Kotlin Android Architecture
MVVM + Kotlin + Retrofit2 + Hilt + Coroutines + Kotlin Flow + mockK + Espresso + Junit5
Stars: ✭ 1,014 (+805.36%)
Mutual labels:  rxjava, mvp, android-architecture
mvp with dagger
How presenters survive Activity recreations on configuration changes with Dagger2
Stars: ✭ 29 (-74.11%)
Mutual labels:  mvp, dagger, android-architecture
Android-Learning-Resources
My curated list of resources for learning Android Development.
Stars: ✭ 24 (-78.57%)
Mutual labels:  rxjava, mvp, dagger
Android Mvp Interactor Architecture
Extension of the android-mvp-architecture for very large projects.
Stars: ✭ 388 (+246.43%)
Mutual labels:  rxjava, mvp, dagger
WanAndroid
💪 WanAndroid应用,持续更新,不断打造成一款持续稳定, 功能完善的应用
Stars: ✭ 50 (-55.36%)
Mutual labels:  rxjava, mvp, dagger
Karchi
Repository that showcases 3 different Android app architectures, all with Java and Kotlin versions: "Standard Android", MVP and MVVM. The exact same app is built 6 times following the different patterns.
Stars: ✭ 20 (-82.14%)
Mutual labels:  architecture, mvp, android-architecture
Mvpframes
整合大量主流开源项目并且可高度配置化的 Android MVP 快速集成框架,支持 AndroidX
Stars: ✭ 100 (-10.71%)
Mutual labels:  rxjava, mvp, dagger
Thirtyinch
a MVP library for Android favoring a stateful Presenter
Stars: ✭ 1,052 (+839.29%)
Mutual labels:  rxjava, architecture, mvp
Android Clean Architecture Boilerplate
Apply clean architecture on Android
Stars: ✭ 141 (+25.89%)
Mutual labels:  rxjava, architecture, mvp
Marvel
Marvel Characters Android Application Assigned by smava GmbH
Stars: ✭ 227 (+102.68%)
Mutual labels:  rxjava, mvp, dagger

Android Architecture

概述

该项目结合 MVP 与 Clean 架构思想,探索在 Android 项目上的最佳实践。

遵循 Clean Architecture 的原则。

architecture
  • 数据层(Data Layer):加入数据转换层(Mapper)将服务端数据模型(Entity)与本地数据模型(Model)解耦。
  • 业务层(Domain Layer):按模块划分业务,具体业务交给 Usecase 处理。
  • 显示层(View Layer): Presenter 不再与 Activity/Fragment 一一对应,Presenter 按照业务模块划分功能,大大提高 Presenter 的复用性。Activity/Fragment 中可以实现多个 View,持有多个 Presenter 来完成业务逻辑。

示例

分支 描述
master 演示了 Model-View-Presenter(MVP)+ Clean 架构,提供一些基类,状态栏沉浸适配等
develop 使用 butterknife
develop-dagger 加入 dagger 的支持
develop-dagger-rxjava 加入 rxjava 的支持

数据层(Data Layer)

data.png

数据层(Data Layer)主要是数据获取与数据缓存策略的处理。

比如:第一次获取到数据,缓存到持久层(持久层可以放入数据库,SharedPreferences,文件或者其他形式)和内存中;第二次获取数据时应优先从内存中读取,其次是持久层,若本地缓存失效则直接从远程服务端获取,然后缓存到本地。

具体实现参见 UserRepository

业务层(Domain Layer)

domain-data

业务层(Domain Layer)主要是根据业务需求来操作数据的逻辑。业务层将每条需求交个 Usecase 来处理,Usecase 通过 Repository 来获取数据。业务层与数据层解耦,方便扩展与测试。

具体实现参见 LoginRemoteTask

显示层(View Layer)

view-domain

显示层(View Layer)主要是数据的展示与更新操作。显示层通过 Presenter 与业务层交互,Activity / Fragment 与 Presenter 解耦,将业务实现由 Presenter 组合而成。Presenter 与 View 对应,Activity / Fragment 由多个 View 管理。

具体实现参见 LoginActivity

项目结构

architecture

参考资料

扫一扫关注我的公众账号

关于我

如果对你有帮助,请 star 一下,然后 follow 我,给我增加一下分享动力,谢谢!

如果你有什么疑问或者问题,可以提交 issue 和 request,发邮件给我 [email protected]

或者加入下面的 QQ 群来一起学习交流。

Android技术进阶:386463747

License

Copyright 2016 jeanboy

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].