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?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
I found this Writing Testable Android MVVM App series written about MVVM using Android Data Binding library is really nice. In the series he explained from simple example to recyclerview, and there are tests as well.
You can maybe try the mv2m library, too.
Recently I have implemented the MVVM pattern for building an Android app with Data Binding Library. Here you can read the detailed review of the work I have done and the code fragments: http://cases.azoft.com/mvvm-android-data-binding/
To learn more about the topic, you can also have a look at these app samples: https://github.com/ivacf/archi
There are visual examples of work done with the search and list screen.
You can follow these steps for DataBinding in Fragments: I have posted design and java class both in Example for Binding Data in Fragment.
Developer site DataBinding Guide Line
https://github.com/MindorksOpenSource/android-mvvm-architecture
Android MVVM Architecture: Sample App
This repository contains a detailed sample app that implements MVVM architecture using Dagger2, Room, RxJava, FastAndroidNetworking, PlaceHolderView and AndroidDebugDatabase
The app has following packages:
There is one project called MVVMCross.
It's free, open-source and well designed MVVM framework, developed by Stuart Lodge.
He implemented binding for Android and iPhone, so now MVVM is applicable to all of these platforms too.
For me it is one of the best MVVM frameworks - it really shows the power of MVVM. With it you can write one code (model and viewmodel layers) for different platforms (WP7, Android, iPhone, WinRT) and just change application UI (view layer).
Android-Data-Binding library is a tool for connecting data to user interface elements. Once the layout file created and each item is tagged, one line of code binds all the data to user interface elements and saves your time for other tasks.