Archi

Repository that showcases 3 Android app architectures: "Standard Android", MVP and MVVM. The exact same app is built 3 times following the different patterns.
Alternatives To Archi
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Ribs7,32363 days ago12April 24, 2022102apache-2.0Kotlin
Uber's cross-platform mobile architecture framework.
Effectiveandroidui6,058
a year ago5apache-2.0Java
Sample project created to show some of the best Android practices to work in the Android UI Layer. The UI layer of this project has been implemented using MVP or MVVM (without binding engine) to show how this patterns works. This project is used during the talk "EffectiveAndroidUI".
Androidproject5,116
7 months ago1apache-2.0Java
Android 技术中台,但愿人长久,搬砖不再有
Westore4,08212 months ago7September 27, 202161JavaScript
小程序项目分层架构
Archi3,363
3 years ago11apache-2.0Java
Repository that showcases 3 Android app architectures: "Standard Android", MVP and MVVM. The exact same app is built 3 times following the different patterns.
Android Mvp Mvvm Flytour2,885
2 years ago8apache-2.0Java
🔥🔥🔥 FlyTour是Android MVVM+MVP+Dagger2+Retrofit+RxJava+组件化+插件组成的双编码架构+双工程架构+双语言Android应用开发框架,通过不断的升级迭代该框架已经有了十个不同的版本,5.0之前工程架构采用gradle配置实现组件化,5.0之后的工程架构采用VirtualAPK实现了插件化,5.0之前采用Java编码实现,5.0之后采用Kotlin编码实现,编码架构由MVVM和MVP组成,工程架构和编码架构及编码语言开发者可根据自己具体的项目实际需求去决定选择使用,该框架是Android组件化、Android插件化、Android MVP架构、Android MVVM架构的集大成者,帮助你快速的搭建自己的App项目开发框架,以便把主要的精力放在自己的项目的业务功能实现上,另外在长期的工作实践中总结整理大量的实用工具类在项目lib_common组件的util包当中方便大家调用。
Android Learning Resources1,289
3 years ago2
Android学习资源网站索引大全
Mvvm Kotlin Android Architecture1,147
2 years ago6apache-2.0Kotlin
MVVM + Kotlin + Retrofit2 + Hilt + Coroutines + Kotlin Flow + mockK + Espresso + Junit5
Thirtyinch1,040
2 years ago34apache-2.0Java
a MVP library for Android favoring a stateful Presenter
Bigshow19491,036
2 years ago7Objective-C
iOS教学/各类知识点总结:运行时/贝塞尔曲线/水纹/粒子发射器/核心动画/渐变色/网络请求/按钮/标签/视图布局/视图效果/文字视图/表情键盘/旋转动画/2048/网易/微信/猿题库/阿里巴巴/设计模式/数据持久化/多次点击按钮/微信注册按钮/展开按钮/跑马灯/闪烁文字/球形滚动标签/自动布局标签/快播动态标签/水平滚动布局/瀑布流布局/浏览卡/半圆布局/滑动标题/抽卡效果/百度视图切换/领英动画/折卡效果/卡牌拖动翻页/滚动悬浮视图/侧滑形变效果/评分条/打印机特效/Masonry/生命周期/响应者链条/引导页/通知中心/抖动密码框/余额宝数字跳动/UIDynamic/碰撞行为/捕捉行为/推动行为/附着行为/动力元素行为/GCD/KVC&KVO/多继承/消息转发/二维码/MVC/MVP/MVVM/Router/Viper
Alternatives To Archi
Select To Compare


Alternative Project Comparisons
Readme

Archi

This repository showcases and compares different architectural patterns that can be used to build Android apps. The exact same sample app is built three times using the following approaches:

  • Standard Android: traditional approach with layouts, Activities/Fragments and Model.
  • MVP: Model View Presenter.
  • MVVM: Model View ViewModel with data binding.

The App

The sample app displays a list of GitHub public repositories for a given username. Tapping on one of them will open a repository details screen, where more information about the repo can be found. This screen also shows information about the owner of the repository.

Screenshots

Libraries used

  • AppCompat, CardView and RecyclerView
  • Data Binding (only MVVM)
  • RxJava & RxAndroid
  • Retrofit 2
  • Picasso
  • Mockito
  • Robolectric

Standard Android

The /app directoy contains the implementation that follows the traditional standard Android approach. This is a couple of layout files, two Activities and the model. The model is exactly the same for the three implementations and it contains: Repository, User and a retrofit service (GithubService).

With this approach, Activities are in charge of calling the GithubService, processing the data and updating the views. They act kind of like a controller in MVC but with some extra responsibilities that should be part of the view. The problem with this standard architecture is that Activities and Fragments can become quite large and very difficult to tests. Hence why I didn't write any unit test for this case.

MVP - Model View Presenter

In /app-mvp you will find the sample app implemented following this pattern. When using mvp, Activities and Fragments become part of the view layer and they delegate most of the work to presenters. Each Activity has a matching presenter that handles accessing the model via the GithubService. They also notify the Activities when the data is ready to display. Unit testing presenters becomes very easy by mocking the view layer (Activities).

MVVM - Model View ViewModel

This pattern has recently started to gain popularity due to the release of the data binding library. You will find the implementation in /app-mvvm. In this case, ViewModels retrieve data from the model when requested from the view via data binding. With this pattern, Activities and Fragments become very lightweight. Moreover, writting unit tests becomes easier because the ViewModels are decoupled from the view.

License

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.
Popular Mvvm Projects
Popular Mvp Projects
Popular Software Architecture Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Java
Mvvm
Fragments
Mvp