SlideShare a Scribd company logo
Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo
Director of Engineering, Apalon NYC.
● nicholas.gustilo@iacapps.com
● https://www.linkedin.com/in/nicholas-gustilo-b893a561
Nicholas Gustilo "Clean Android: building great mobile apps"
Apalon Translation Tool
I am pleased to announce, that today we are releasing an open source translation
tool that dramatically simplifies the management of strings of Android apps. The
tool consists of:
● Uses a google spreadsheet to manage all translated strings.
● A gradle plugin
● A library (jar file)
● Call ./gradlew updateTranslations
● https://github.com/Apalon/translation-tool
Agenda
1. What is clean architecture and why should you care?
2. App organization and naming.
3. Process and libraries.
4. Reactive programming (costs / benefits)
5. Questions
What is Clean Architecture?
● What do I mean by architecture?
○ Organization of the code, including, naming conventions and package organization, libraries
chosen, the design patterns used and structure of the source code.
● What do we mean by “clean”?
○ Tidy (not messy)? Organized? Not dirty? Clear? Understandable? Simple? Modular!
● Useful links
○ http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
○ http://www.codingthearchitecture.com/2011/11/22/re_clean_architecture.html
What are the benefits of clean architecture?
● Easy to understand - for example, easily map app to code.
● Easier to refactor. Easier to debug and fix.
● Easy for multiple engineers to work on at the same time.
Practical Clean Architecture Tips
1. Organize your code and use good naming conventions
2. Make code modular (how?)
3. Less is more. Use tools that minimize the code that needs to be maintained.
4. Use consistent design patterns (Reactive/MVC/MVP).
App Organization (packages) and Naming
● Demo
Process and Libraries
● Process: Agile (2 week sprints), Android Studio, gradle, git, GitLab, JIRA
● Libraries: butterknife, okhttp3, retrofit, picasso
● Libraries (reactive): rxjava, rx-bindings, rx-preferences, retrofit
● Libraries (other): stetho, leak-canary, apalon-translation-tool
Reactive
What is Reactive? Why should you care? Is it worth the effort?
Reactive - Costs
● Substantial learning curve.
● Clash of APIs (very different from much of android).
● MUST unsubscribe or you have memory leaks.
Reactive - Benefits
Reactive programming combines three features into a compelling technology.
1. Observable/Subscriber design pattern.
2. Thread management
3. Operators to “transform” data
Reactive - Observable/Subscriber
● Observable has a one-to-many relationship with subscribers (or subscriber
objects) so that when the observables state changes all the subscribers are
notified automatically.
● For example, public Observable<List<Item>> getImages()
● Subscriber is an object that “subscribes” to an observable and when notified
is able to process changes using the data provided by the observable.
● For example, this.model.getImages().subscribe(images -> { … });
Reactive - Life Cycle
Reactive - Thread Management
● Compared to standard Android threading technologies reactive handles
threading in a very simple and elegant way.
Reactive - Thread Management
Reactive - Thread Management
Reactive - Thread Management
● Thread management in reactive code is compacted and clear.
Reactive - Operators
● Rxjava supports many operators. Most operators take an Observable as input
and return an Observable. This allows “chaining” of many operators together.
For example, to merge and filter the output of an Observable or control how
an Observable emits data.
Reactive - Operators
Reactive is Awesome! Use it.
Reactive programming combines three features into a compelling technology.
1. Observable/Subscriber design pattern → More modular code.
2. Thread management → Cleaner, easier thread management → more
responsive applications.
3. Operators to “transform” data → Very powerful and (usually) clear way of
managing and controlling data.
Reactive - Architecture Tips
1. In Call Recorder For Me and Coloring Book For Me almost all data is
managed using reactive programming.
2. Activities/Fragments. Subscribe in onResume. Unsubscribe in onPause().
a. Tip: use CompositeSubscription objects.
3. Presenters. Subscribe in UI (view) onAttachedToWindow(). Unsubscribe in UI
(view) onDetachFromWindow().
Reactive - Links
● https://github.com/ReactiveX/RxJava/wiki
● http://reactivex.io/documentation/observable.html
● http://blog.danlew.net/2014/09/15/grokking-rxjava-part-1/
● https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
● http://davesexton.com/blog/post/To-Use-Subject-Or-Not-To-Use-Subject.aspx
● http://tomstechnicalblog.blogspot.com/2016/03/rxjava-problem-with-subjects.
html
Extra - Apalon Translation Tool
Demo
Extra - Subjects
● Subjects are like Observable you can call from anywhere at anytime.
● Easy way to create a “hot” Observable.
● Helps create more modular code.
● Is NOT always thread safe and has gotchas.
○ http://davesexton.com/blog/post/To-Use-Subject-Or-Not-To-Use-Subject.aspx
○ http://tomstechnicalblog.blogspot.com/2016/03/rxjava-problem-with-subjects.html
Extra - Subjects
● private final BehaviorSubject<List<Palette>> paletteBehaviorSubject =
BehaviorSubject.create();
● public BehaviorSubject<List<Category>> getCategoriesObservable() { return
categoriesBehaviorSubject; }
● paletteBehaviorSubject.onNext(paletteList);
Extra - Rx-preferences
● if( MyPreferences.get().isPremium().get() ) { … }
● MyPreferences.get().isPremium().set(true);
● MyPreferences.get().isPremium().asObservable().subscribe (premiumFlag →
{ … });

More Related Content

PDF
Milos Marinkovic "Modular Android UI"
PPTX
Annotation processing
PDF
Android Modularization
PDF
Integrating react in django while staying sane and happy
PDF
Android application architecture
PPTX
Clean architecture on android
PDF
Android clean architecture workshop 3h edition
PPTX
[Android] DI in multimodule application
Milos Marinkovic "Modular Android UI"
Annotation processing
Android Modularization
Integrating react in django while staying sane and happy
Android application architecture
Clean architecture on android
Android clean architecture workshop 3h edition
[Android] DI in multimodule application

What's hot (20)

PPTX
Gradle and Android Studio : Best of Friends
PDF
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
PDF
Django: Beyond Basics
PDF
Gradle & Android Studio - Introduction
PDF
Chasing the RESTful Trinity - Client CLI and Documentation
PDF
Reuse features in Android applications
PDF
Dagger2 Intro
PPTX
What is dev ops?
PDF
A Separation of Concerns: Clean Architecture on Android
PPTX
Integration of automation framework with ci tools
PDF
GraalVM and MicroProfile - A Polyglot Microservices Solution
PDF
Designing a json/rest api for your mobile app
PDF
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
PPTX
Exploring the power of Gradle in android studio - Basics & Beyond
PDF
Android Clean Architecture for Dummies
PPTX
Introducing swagger
PDF
Using Dagger in a Clean Architecture project
PDF
Mikki Mesfin's Resume
PDF
Getting Started With Django
PDF
Building End-to-End Apps Using Typescript
Gradle and Android Studio : Best of Friends
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
Django: Beyond Basics
Gradle & Android Studio - Introduction
Chasing the RESTful Trinity - Client CLI and Documentation
Reuse features in Android applications
Dagger2 Intro
What is dev ops?
A Separation of Concerns: Clean Architecture on Android
Integration of automation framework with ci tools
GraalVM and MicroProfile - A Polyglot Microservices Solution
Designing a json/rest api for your mobile app
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Exploring the power of Gradle in android studio - Basics & Beyond
Android Clean Architecture for Dummies
Introducing swagger
Using Dagger in a Clean Architecture project
Mikki Mesfin's Resume
Getting Started With Django
Building End-to-End Apps Using Typescript
Ad

Viewers also liked (19)

PPTX
2.1 principios y aspectos básicos del aicle -clil
PPTX
Microprocesadores
PDF
Lei arbitragem +alteraçoe scomentarios
PPTX
140210111099
PPT
Petcomposteira
PDF
DeborahBuck_Portfolio
DOCX
Audit & Corporate Governance - Professional Scepticism
PPT
Sal reduzaoconsumo
PDF
Андрей Беленко "Безопасность мобильных приложений "
DOCX
D. civil vol. 3 -2014 - Tartuce, Flavio
PPTX
3 diseño de actividades para el aula clil
PPTX
2 principios y aspectos básicos del aicle -clil
PDF
Como explicar o Bloco K e o eSocial para empresários
ODP
Promocion balonmano ceip_san_tesifon_octubre_2016
PPTX
Photoshoot
PDF
Best Practices in Content Marketing for the Travel Industry
PPTX
Impeachment Brasil 2016
DOC
Ahora si que no tengo dudas. los reyes magos existen
2.1 principios y aspectos básicos del aicle -clil
Microprocesadores
Lei arbitragem +alteraçoe scomentarios
140210111099
Petcomposteira
DeborahBuck_Portfolio
Audit & Corporate Governance - Professional Scepticism
Sal reduzaoconsumo
Андрей Беленко "Безопасность мобильных приложений "
D. civil vol. 3 -2014 - Tartuce, Flavio
3 diseño de actividades para el aula clil
2 principios y aspectos básicos del aicle -clil
Como explicar o Bloco K e o eSocial para empresários
Promocion balonmano ceip_san_tesifon_octubre_2016
Photoshoot
Best Practices in Content Marketing for the Travel Industry
Impeachment Brasil 2016
Ahora si que no tengo dudas. los reyes magos existen
Ad

Similar to Nicholas Gustilo "Clean Android: building great mobile apps" (20)

PDF
Angular Rebooted: Components Everywhere
PDF
Angular Rebooted: Components Everywhere - Carlo Bonamico, Sonia Pini - Codemo...
PPTX
Distributed tracing 101
PDF
Distributed Tracing
PDF
Semfudtshfusjfusjdjshfjzhshshdhdjstejdhfinar.pdf
PDF
Semjfxhxgznxhxjzfzgshfhxjghxjcdhdhffinar.pdf
PPTX
Software Development with PHP & Laravel
PDF
Carlo Bonamico, Sonia Pini - So you want to build your (Angular) Component Li...
PDF
Build Your Own Angular Component Library
PPTX
Reactive Programming on Android - RxAndroid - RxJava
PDF
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
PDF
BISSA: Empowering Web gadget Communication with Tuple Spaces
ODP
JavaFX in Action Part I
PPTX
Microservices Part 4: Functional Reactive Programming
PDF
Fighting legacy with hexagonal architecture and frameworkless php
PDF
Design patterns for fun & profit - CoderCruise 2018
PDF
React vs Angular: A Comprehensive Comparison for Frontend Development
PPTX
Functional reactive programming
PDF
How I learned to time travel, or, data pipelining and scheduling with Airflow
PPTX
AngularJS best practices
Angular Rebooted: Components Everywhere
Angular Rebooted: Components Everywhere - Carlo Bonamico, Sonia Pini - Codemo...
Distributed tracing 101
Distributed Tracing
Semfudtshfusjfusjdjshfjzhshshdhdjstejdhfinar.pdf
Semjfxhxgznxhxjzfzgshfhxjghxjcdhdhffinar.pdf
Software Development with PHP & Laravel
Carlo Bonamico, Sonia Pini - So you want to build your (Angular) Component Li...
Build Your Own Angular Component Library
Reactive Programming on Android - RxAndroid - RxJava
ML Platform Q1 Meetup: Airbnb's End-to-End Machine Learning Infrastructure
BISSA: Empowering Web gadget Communication with Tuple Spaces
JavaFX in Action Part I
Microservices Part 4: Functional Reactive Programming
Fighting legacy with hexagonal architecture and frameworkless php
Design patterns for fun & profit - CoderCruise 2018
React vs Angular: A Comprehensive Comparison for Frontend Development
Functional reactive programming
How I learned to time travel, or, data pipelining and scheduling with Airflow
AngularJS best practices

More from IT Event (20)

PDF
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
PDF
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
PDF
Max Voloshin - "Organization of frontend development for products with micros...
PDF
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
PDF
Konstantin Krivlenia - "Continuous integration for frontend"
PPTX
Illya Klymov - "Vue.JS: What did I swap React for in 2017 and why?"
PDF
Evgeny Gusev - "A circular firing squad: How technologies drag frontend down"
PDF
Vladimir Grinenko - "Dependencies in component web done right"
PDF
Dmitry Bartalevich - "How to train your WebVR"
PDF
Aleksey Bogachuk - "Offline Second"
PDF
James Allardice - "Building a better login with the credential management API"
PDF
Fedor Skuratov "Dark Social: as messengers change the market of social media ...
PPTX
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
PPTX
Алексей Рагозин "Java и linux борьба за микросекунды"
PPTX
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
PDF
Наш ответ Uber’у
PDF
Александр Крашенинников "Hadoop High Availability: опыт Badoo"
PDF
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
PDF
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
PDF
Mete Atamel "Resilient microservices with kubernetes"
Denis Radin - "Applying NASA coding guidelines to JavaScript or airspace is c...
Sara Harkousse - "Web Components: It's all rainbows and unicorns! Is it?"
Max Voloshin - "Organization of frontend development for products with micros...
Roman Romanovsky, Sergey Rak - "JavaScript в IoT "
Konstantin Krivlenia - "Continuous integration for frontend"
Illya Klymov - "Vue.JS: What did I swap React for in 2017 and why?"
Evgeny Gusev - "A circular firing squad: How technologies drag frontend down"
Vladimir Grinenko - "Dependencies in component web done right"
Dmitry Bartalevich - "How to train your WebVR"
Aleksey Bogachuk - "Offline Second"
James Allardice - "Building a better login with the credential management API"
Fedor Skuratov "Dark Social: as messengers change the market of social media ...
Андрей Зайчиков "Архитектура распределенных кластеров NoSQL на AWS"
Алексей Рагозин "Java и linux борьба за микросекунды"
Volodymyr Lyubinets "Introduction to big data processing with Apache Spark"
Наш ответ Uber’у
Александр Крашенинников "Hadoop High Availability: опыт Badoo"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Анатолий Пласковский "Миллионы карточных платежей за месяц, или как потерять ...
Mete Atamel "Resilient microservices with kubernetes"

Recently uploaded (20)

PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Cell Types and Its function , kingdom of life
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Insiders guide to clinical Medicine.pdf
PPTX
master seminar digital applications in india
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
STATICS OF THE RIGID BODIES Hibbelers.pdf
Cell Structure & Organelles in detailed.
human mycosis Human fungal infections are called human mycosis..pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Classroom Observation Tools for Teachers
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx
Cell Types and Its function , kingdom of life
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Supply Chain Operations Speaking Notes -ICLT Program
Renaissance Architecture: A Journey from Faith to Humanism
VCE English Exam - Section C Student Revision Booklet
O7-L3 Supply Chain Operations - ICLT Program
Insiders guide to clinical Medicine.pdf
master seminar digital applications in india
2.FourierTransform-ShortQuestionswithAnswers.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf

Nicholas Gustilo "Clean Android: building great mobile apps"

  • 2. Nicholas Gustilo Director of Engineering, Apalon NYC. ● nicholas.gustilo@iacapps.com ● https://www.linkedin.com/in/nicholas-gustilo-b893a561
  • 4. Apalon Translation Tool I am pleased to announce, that today we are releasing an open source translation tool that dramatically simplifies the management of strings of Android apps. The tool consists of: ● Uses a google spreadsheet to manage all translated strings. ● A gradle plugin ● A library (jar file) ● Call ./gradlew updateTranslations ● https://github.com/Apalon/translation-tool
  • 5. Agenda 1. What is clean architecture and why should you care? 2. App organization and naming. 3. Process and libraries. 4. Reactive programming (costs / benefits) 5. Questions
  • 6. What is Clean Architecture? ● What do I mean by architecture? ○ Organization of the code, including, naming conventions and package organization, libraries chosen, the design patterns used and structure of the source code. ● What do we mean by “clean”? ○ Tidy (not messy)? Organized? Not dirty? Clear? Understandable? Simple? Modular! ● Useful links ○ http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod ○ http://www.codingthearchitecture.com/2011/11/22/re_clean_architecture.html
  • 7. What are the benefits of clean architecture? ● Easy to understand - for example, easily map app to code. ● Easier to refactor. Easier to debug and fix. ● Easy for multiple engineers to work on at the same time.
  • 8. Practical Clean Architecture Tips 1. Organize your code and use good naming conventions 2. Make code modular (how?) 3. Less is more. Use tools that minimize the code that needs to be maintained. 4. Use consistent design patterns (Reactive/MVC/MVP).
  • 9. App Organization (packages) and Naming ● Demo
  • 10. Process and Libraries ● Process: Agile (2 week sprints), Android Studio, gradle, git, GitLab, JIRA ● Libraries: butterknife, okhttp3, retrofit, picasso ● Libraries (reactive): rxjava, rx-bindings, rx-preferences, retrofit ● Libraries (other): stetho, leak-canary, apalon-translation-tool
  • 11. Reactive What is Reactive? Why should you care? Is it worth the effort?
  • 12. Reactive - Costs ● Substantial learning curve. ● Clash of APIs (very different from much of android). ● MUST unsubscribe or you have memory leaks.
  • 13. Reactive - Benefits Reactive programming combines three features into a compelling technology. 1. Observable/Subscriber design pattern. 2. Thread management 3. Operators to “transform” data
  • 14. Reactive - Observable/Subscriber ● Observable has a one-to-many relationship with subscribers (or subscriber objects) so that when the observables state changes all the subscribers are notified automatically. ● For example, public Observable<List<Item>> getImages() ● Subscriber is an object that “subscribes” to an observable and when notified is able to process changes using the data provided by the observable. ● For example, this.model.getImages().subscribe(images -> { … });
  • 16. Reactive - Thread Management ● Compared to standard Android threading technologies reactive handles threading in a very simple and elegant way.
  • 17. Reactive - Thread Management
  • 18. Reactive - Thread Management
  • 19. Reactive - Thread Management ● Thread management in reactive code is compacted and clear.
  • 20. Reactive - Operators ● Rxjava supports many operators. Most operators take an Observable as input and return an Observable. This allows “chaining” of many operators together. For example, to merge and filter the output of an Observable or control how an Observable emits data.
  • 22. Reactive is Awesome! Use it. Reactive programming combines three features into a compelling technology. 1. Observable/Subscriber design pattern → More modular code. 2. Thread management → Cleaner, easier thread management → more responsive applications. 3. Operators to “transform” data → Very powerful and (usually) clear way of managing and controlling data.
  • 23. Reactive - Architecture Tips 1. In Call Recorder For Me and Coloring Book For Me almost all data is managed using reactive programming. 2. Activities/Fragments. Subscribe in onResume. Unsubscribe in onPause(). a. Tip: use CompositeSubscription objects. 3. Presenters. Subscribe in UI (view) onAttachedToWindow(). Unsubscribe in UI (view) onDetachFromWindow().
  • 24. Reactive - Links ● https://github.com/ReactiveX/RxJava/wiki ● http://reactivex.io/documentation/observable.html ● http://blog.danlew.net/2014/09/15/grokking-rxjava-part-1/ ● https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 ● http://davesexton.com/blog/post/To-Use-Subject-Or-Not-To-Use-Subject.aspx ● http://tomstechnicalblog.blogspot.com/2016/03/rxjava-problem-with-subjects. html
  • 25. Extra - Apalon Translation Tool Demo
  • 26. Extra - Subjects ● Subjects are like Observable you can call from anywhere at anytime. ● Easy way to create a “hot” Observable. ● Helps create more modular code. ● Is NOT always thread safe and has gotchas. ○ http://davesexton.com/blog/post/To-Use-Subject-Or-Not-To-Use-Subject.aspx ○ http://tomstechnicalblog.blogspot.com/2016/03/rxjava-problem-with-subjects.html
  • 27. Extra - Subjects ● private final BehaviorSubject<List<Palette>> paletteBehaviorSubject = BehaviorSubject.create(); ● public BehaviorSubject<List<Category>> getCategoriesObservable() { return categoriesBehaviorSubject; } ● paletteBehaviorSubject.onNext(paletteList);
  • 28. Extra - Rx-preferences ● if( MyPreferences.get().isPremium().get() ) { … } ● MyPreferences.get().isPremium().set(true); ● MyPreferences.get().isPremium().asObservable().subscribe (premiumFlag → { … });