https://github.com/evant/pokemvvm
A playground for MVVM style architecture on Android
https://github.com/evant/pokemvvm
Last synced: 11 months ago
JSON representation
A playground for MVVM style architecture on Android
- Host: GitHub
- URL: https://github.com/evant/pokemvvm
- Owner: evant
- License: apache-2.0
- Created: 2016-03-22T02:18:48.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2020-06-14T22:50:38.000Z (about 6 years ago)
- Last Synced: 2025-04-21T17:41:18.716Z (about 1 year ago)
- Language: Java
- Size: 125 KB
- Stars: 17
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PokeMVVM
A playground for MVVM style architecture on Android
This architecture relies heavily on android databinding, but requires _nothing_ else not provided by the framework. You split up you app into the following components:
## Model
Holds are your data and buisness logic. You shouldn't need any of the android fragmework for this.
## View
Includes your layout files and any custom views you need to create. Have a very simple lifecycle of being created and destroyed on configuration changes. You use databinding to connect this to your view model.
## View Model
Includes are the logic to display your models and respond to user events. These have the same lifecycle of views.
## Api/Database
These obtain and store your data, often asynchrnously, but don't care about Android's lifecycle.
## Activity/Fragments
Used to coordinate the above components and deal with lifecycle events. May use loaders to get data from the api into the view model. Be careful with these, as soon as you need to do anything more complex than simple coordination, move it into it's own class.