Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/futtetennista/tradingapp
An exploration on porting a elm-like architecture on Android
https://github.com/futtetennista/tradingapp
android android-app elm-architecture kotlin-android rxandroid2 rxjava rxkotlin rxkotlin-android websockets
Last synced: about 1 month ago
JSON representation
An exploration on porting a elm-like architecture on Android
- Host: GitHub
- URL: https://github.com/futtetennista/tradingapp
- Owner: futtetennista
- License: mit
- Created: 2017-12-09T14:23:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-09T15:45:11.000Z (about 7 years ago)
- Last Synced: 2024-10-31T12:46:25.618Z (3 months ago)
- Topics: android, android-app, elm-architecture, kotlin-android, rxandroid2, rxjava, rxkotlin, rxkotlin-android, websockets
- Language: Kotlin
- Homepage:
- Size: 200 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trading App
## Architecture
I wanted to explore the Elm architecture and Redux way of building apps on Android. It is heavily
inspired by this talk:
[Managing State with RxJava](https://speakerdeck.com/jakewharton/the-state-of-managing-state-with-rxjava-devoxx-us-2017).
The naming conventions are the same and might look weird for people not familiar the aforementioned
frameworks, in a nutshell:* Model: defines common types and data structures
* View: defines how data is displayed - that is in Android lingo an `Activity`, a `Fragment`, a `View`
* Update: defines interactions, it's responsible for most of the state handling and app logicThose three files encapsulate classes related to those components of the architecture, the `RestApi`
and `WebSocketApi` files contain code that handles a trading API.## Tradeoffs
- UI is minimal since it was not the focus of the assignment
- I found handling websockets with Rx was particularly challenging and I'm not 100% convinced the way
I've done it it's the cleanest, clearest and more elegan; it probably need a couple more iterations.## Improvements
I don't know if you're familiar with Reactive Extensions and RxJava but I couldn't find elegant
solutions in a couple of places (marked with TODO#Improve). In case you are familiar with it, I'd
appreciate some feedback on that if you've got any.# Known bugs
If you're testing the app using an emulator, fetching a new product id won't work because of [this
issue](https://github.com/square/okhttp/issues/3278) in okhttp## Building the app
I used Gradle and all standard Android tools so you shouldn't have any issues with it.