SlideShare a Scribd company logo
Android Clean Architecture with Kotlin and RxJava
Android Clean Architecture
A Reactive Approach with Kotlin
Adrián Santalla
2
Adrián Santalla
• I’m an Android Engineer @ Cabify.
• I’ve worked as a Web Applications Developer,
in the past.
• I’ve always worked with Java technologies:
Groovy/Grails, Android, Kotlin …
3
Introduction
4
Introduction
An application with a solid architecture should
be:
• Easy to scale and maintain.
• Each component should be isolated and
decoupled.
• Easy to test.
• Independent of frameworks?
5
Introduction
6
Independent of frameworks?
• Not in this case.
• RxJava + Kotlin + Android fits very well
together.
• Everything is combined with Dagger 2.
• The main problem could be the RxJava
learning curve.
+
A good software architecture should accomplish
the following principles:
• Responsive: the capability to respond in a
timely manner if at all possible.
• Resilient: the capability to stay responsive in
the face of failure.
• Elastic: the capability to stay responsive under
varying of workload.
• Isolation: the capability to to isolate its
functionality in decoupled components.
7
Why reactive pattern?
8
Introduction
Architectural layers
9
Client
• A client is responsible to manage low level
data.
• It’s platform dependent.
• The libraries to manage data are prepare to
support RxJava.
• Retrofit (API), Realm (DB) and Room (DB)
supports RxJava.
10
11
Client
Repository
12
• A repository is a data source.
• Wraps the provided data from the client into
Transaction objects.
• RxJava provides operations to modify the
client Observable and return a valid object for
our architecture.
13
Repository - ApiRequest
14
Repository - Api & Cache
Model
15
• A model is an entity provider.
• Combines from 1 to N repositories to obtain
entities.
• A model is responsible to maintain all its data
updated.
16
Model
Service
17
• A service is responsible to manage the
business logic.
• Combines from 1 to N Models.
• Services are intended to store data shared
between different use cases.
18
Service
Use Case
19
• A Use Case represents a concrete business
logic.
• Combines from 1 to N Services.
• Each screen action could be represented by a
Use Case.
20
Use Case
Presenter
21
• A Presenter is responsible to manage the
view.
• Views are silly, they don’t care about data.
• A view inits its Presenter and delegates
everything to the it.
22
Presenter - Fragment
23
PresenterView
24
Activity PresenterView
Presenter
Recap
25
• Completely platform independent.
• Transaction objects allow you to manage errors in the lowest architectural layers.
• In case of errors, a Transaction is a valid object of your architecture.
• Easy to scale, maintain and test.
• Fully reactive, from Presenter to the client side.
26
Recap
• Android Clean Architecture Lib & Sample App:
• https://github.com/asantalla/AndroidCleanArchitecture
• RxJava:
• https://github.com/ReactiveX/RxJava
• ReactiveX:
• http://reactivex.io/
• Android Clean Architecture
• https://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/
• https://medium.com/@dmilicic/a-detailed-guide-on-developing-android-apps-using-the-
clean-architecture-pattern-d38d71e94029
27
Links
Questions?
28
Thanks!

More Related Content

PDF
Alexandra johnson reducing operational barriers to model training
PDF
Dances with bits - industrial data analytics made easy!
PPTX
Take Your Reports to Any Screen with Telerik Reporting
PDF
Multitenant SaaS Apps In Rails By Iqbal Hasnan
PDF
Nimble Athena - Project setup & planning
PDF
Trailblazer Rails Architecture
PPTX
Matlab Guidance Research Ideas
PPTX
MATLAB Projects Research Help
Alexandra johnson reducing operational barriers to model training
Dances with bits - industrial data analytics made easy!
Take Your Reports to Any Screen with Telerik Reporting
Multitenant SaaS Apps In Rails By Iqbal Hasnan
Nimble Athena - Project setup & planning
Trailblazer Rails Architecture
Matlab Guidance Research Ideas
MATLAB Projects Research Help

Similar to Android Clean Architecture with Kotlin and RxJava (20)

PPTX
Architecting modern Android apps
PPSX
SOLID Principles and The Clean Architecture
PDF
Nicholas Gustilo "Clean Android: building great mobile apps"
PDF
Clean Architecture in Android. UPTech TechTalk
PDF
Tips for React Native Code Architecture in Saudi Arabian Apps
PDF
Clean Architecture
PPTX
Clean architecture on android
PDF
Clean Architecture @ Taxibeat
PDF
Clean Architecture
PDF
Android app development SEO Expert Bangladesh LTD.pdf
PDF
Android app development SEO Expert Bangladesh LTD.pdf
PPTX
Clean architecture
PDF
Clean Architecture
PDF
Five android architecture
PDF
Innovation Generation - The Mobile Meetup: Android Best Practices
PDF
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
PDF
Android application architecture
PDF
A Separation of Concerns: Clean Architecture on Android
PDF
Create first android app with MVVM Architecture
Architecting modern Android apps
SOLID Principles and The Clean Architecture
Nicholas Gustilo "Clean Android: building great mobile apps"
Clean Architecture in Android. UPTech TechTalk
Tips for React Native Code Architecture in Saudi Arabian Apps
Clean Architecture
Clean architecture on android
Clean Architecture @ Taxibeat
Clean Architecture
Android app development SEO Expert Bangladesh LTD.pdf
Android app development SEO Expert Bangladesh LTD.pdf
Clean architecture
Clean Architecture
Five android architecture
Innovation Generation - The Mobile Meetup: Android Best Practices
Java & JavaScipt Reactive Robotics and IoT 2016 @ jProfessionals
Android application architecture
A Separation of Concerns: Clean Architecture on Android
Create first android app with MVVM Architecture
Ad

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
medical staffing services at VALiNTRY
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Transform Your Business with a Software ERP System
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Essential Infomation Tech presentation.pptx
PPTX
ai tools demonstartion for schools and inter college
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
AI in Product Development-omnex systems
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Which alternative to Crystal Reports is best for small or large businesses.pdf
L1 - Introduction to python Backend.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
medical staffing services at VALiNTRY
Operating system designcfffgfgggggggvggggggggg
Transform Your Business with a Software ERP System
How Creative Agencies Leverage Project Management Software.pdf
Essential Infomation Tech presentation.pptx
ai tools demonstartion for schools and inter college
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Navsoft: AI-Powered Business Solutions & Custom Software Development
AI in Product Development-omnex systems
Odoo Companies in India – Driving Business Transformation.pdf
Odoo POS Development Services by CandidRoot Solutions
Understanding Forklifts - TECH EHS Solution
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Ad

Android Clean Architecture with Kotlin and RxJava

  • 2. Android Clean Architecture A Reactive Approach with Kotlin Adrián Santalla 2
  • 3. Adrián Santalla • I’m an Android Engineer @ Cabify. • I’ve worked as a Web Applications Developer, in the past. • I’ve always worked with Java technologies: Groovy/Grails, Android, Kotlin … 3
  • 5. Introduction An application with a solid architecture should be: • Easy to scale and maintain. • Each component should be isolated and decoupled. • Easy to test. • Independent of frameworks? 5
  • 6. Introduction 6 Independent of frameworks? • Not in this case. • RxJava + Kotlin + Android fits very well together. • Everything is combined with Dagger 2. • The main problem could be the RxJava learning curve. +
  • 7. A good software architecture should accomplish the following principles: • Responsive: the capability to respond in a timely manner if at all possible. • Resilient: the capability to stay responsive in the face of failure. • Elastic: the capability to stay responsive under varying of workload. • Isolation: the capability to to isolate its functionality in decoupled components. 7 Why reactive pattern?
  • 10. Client • A client is responsible to manage low level data. • It’s platform dependent. • The libraries to manage data are prepare to support RxJava. • Retrofit (API), Realm (DB) and Room (DB) supports RxJava. 10
  • 12. Repository 12 • A repository is a data source. • Wraps the provided data from the client into Transaction objects. • RxJava provides operations to modify the client Observable and return a valid object for our architecture.
  • 15. Model 15 • A model is an entity provider. • Combines from 1 to N repositories to obtain entities. • A model is responsible to maintain all its data updated.
  • 17. Service 17 • A service is responsible to manage the business logic. • Combines from 1 to N Models. • Services are intended to store data shared between different use cases.
  • 19. Use Case 19 • A Use Case represents a concrete business logic. • Combines from 1 to N Services. • Each screen action could be represented by a Use Case.
  • 21. Presenter 21 • A Presenter is responsible to manage the view. • Views are silly, they don’t care about data. • A view inits its Presenter and delegates everything to the it.
  • 26. • Completely platform independent. • Transaction objects allow you to manage errors in the lowest architectural layers. • In case of errors, a Transaction is a valid object of your architecture. • Easy to scale, maintain and test. • Fully reactive, from Presenter to the client side. 26 Recap
  • 27. • Android Clean Architecture Lib & Sample App: • https://github.com/asantalla/AndroidCleanArchitecture • RxJava: • https://github.com/ReactiveX/RxJava • ReactiveX: • http://reactivex.io/ • Android Clean Architecture • https://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/ • https://medium.com/@dmilicic/a-detailed-guide-on-developing-android-apps-using-the- clean-architecture-pattern-d38d71e94029 27 Links