Android MVVM Design Pattern Examples

2019-01-16 00:19发布

I currently do a lot of WPF development and have started creating some basic Android apps. When creating WPF apps I often use MVVM, normally using Prism, and would like to know if there are any examples of MVVM for the Android platform?

14条回答
地球回转人心会变
2楼-- · 2019-01-16 01:08

There is a relatively new framework being developed that allows for Views to be bound to ViewModels called android-binding. Using this framework and RoboGuice you can get your MVVM on. The framework still needs some work, but it's a good starting point.

查看更多
萌系小妹纸
3楼-- · 2019-01-16 01:08

Just to post as a reference to other people who may be interested. I am a contributor to RoboBinding - A data-binding Presentation Model framework for the Android platform. It is another framework for the same purpose. Apart from helping with project structure, one major focus for RoboBinding is to make testing android apps with normal JUnit tests possible instead of Android unit tests, as Unit tests are so important to guarantee the quality of projects, but Android unit tests take ages to run and make unit tests somewhat impractical. RoboBinding itself comes with more than 300 JUnit tests to ensure its quality. MVVM originated from Microsoft as a specialization of the Presentation Model design pattern introduced by Martin Fowler. Other alternatives: Android-Binding, Bindroid and MvvmCross.

查看更多
登录 后发表回答