android-architecture
Introduction: Functional Android Architecture sample using Kotlin and Kategory
Tags:

This version of the app provides a complete functional architecture using Arrow.
- Provide a basic Model-View-Presenter (MVP)
- Provide complete architecture covering same features found on the
mvp-cleansamples but in a functional way. - Use tagless final style based on typeclasses for abstracting over implementation details.
How to contribute
Default branch is todo-mvp-kotlin-arrow-fp, following the mandatory branch naming for the Google architecture blueprints repo. To contribute, just open your PRs targeting that branch.
Some key points:
- We want to cover the same use cases and replicate the same screens from the original repo (already implemented on this one by Google but under a basic Kotlin style). So we basically need to port those to a different architecture using Arrow.
- We are completely free to remove/add layers, levels of abstraction or whatever, to compose the architecture the way we want. We just need to keep the user visible features as they are in terms of usage.
- We must think about readability and clarity since the goal is to create a base blueprint for the android community to give them a point to start. We don't want to go for super fancy things or styles to showcase how powerful is Arrow, but instead for a "base functional android architecture" for reference. That would be my advice on this, after taking a deep look on what other samples are covering and the scope of the blueprints repo.
- We must cover the same use cases on tests.
- A good way to iterate over is to pick one activity and iterate over it, leaving the resting ones untouched. Once we agree on a given approach, we can move forward and port that to the resting activities. We can easily start by a leaf node on the navigation tree, like the
AddEditTaskActivitywhich is used to add or edit an already existent task on the todo app.
Current status
Currently the app is just a copy of the todo-mvp-kotlin branch from the original repo, so we start working on top of it. Google suggested to use one of
the existent branches to iterate over.
Relevant Dependencies
- Kotlin stdlib
- kotlin-android plugin
- Arrow
Features
Complexity - understandability - resources
High: You need to have a good Kotlin knowledge and be aware of some functional concepts. For deeper details, please check:
- Arrow official docs: Incredible complete and detailed. Code snippets and real world use cases included.
- Talk: Kotlin for the pragmatic functionalist - Paco Estévez: Really good talk about some insights of Arrow, its main goals and its future.
- Talk: Architectures using Functional Programming concepts - Jorge Castillo: Detailed talk about how to build a complete architecture using Arrow, step by step, covering the required monad stack and iterating it to a transformers stack.
- Kotlin Android Functional repo: Android architecture using Arrow and 4 different Functional Programming styles.
- uiagesturegen: How to build a Free monads based DSL to implement UI tests in a really usable, decoupled and fancy way using Arrow and Functional Programming.
- Some insights about FP over Android: Post explaining the benefits of going FP. Is it worth it?
- Monad Stack sample over Android: Post on how to compose a Monad Stack based Android architecture to solve the main concerns that any standard Android app can have.
- Monad Transformers iteration: Covering how to iterate the mentioned monad stack to collapse all the types on a single one to make the structure much more usable and readable.
Testability
- Lets write here some concerns about testability and how we are approaching to them on this sample.
