SlideShare a Scribd company logo
2015/11/17
@kengoScal
Android Clean Architecture
for
Dummies
About Me
2
Self Introduction
name: Kengo Suzuki
twitter: @kengoScal
3
2011∼2014:Security Analyst
2014年11月: Joined MoneyForward
2014年11月∼2015年01月: iOS
2015年02月∼08月:Android
2015年09月∼10月 : Security Architect
2015年11月 : Security Architect/Management + Android
4
In Charge of New Android App!
Android Clean Architecture
5
What is it & Why using it?
6
What is it & Why using it?
7
Not Today.
Plenty of Good Entries(with source codes)
8
• English
• Architecting Android…The Clean Way?
• Clean Android Architecture
• MVP for Android: how to organize presentation
layer
• Japanese
• AndroidオールスターズでClean Architectureについて発
表してきた
• これからの設計の話をしよう
• AndroidではMVCよりMVPの方がいいかもしれない
Plenty of Good Entries(with source codes)
9
• English
• Architecting Android…The Clean Way?
• Clean Android Architecture
• MVP for Android: how to organize presentation
layer
• Japanese
• AndroidオールスターズでClean Architectureについ
て発表してきた
• これからの設計の話をしよう
• AndroidではMVCよりMVPの方がいいかもしれない
Big Picture
Source Code
Roles
Big Picture
Roles
Presenter
Right off the Bat?
10
訳: すぐに/直ちに
Need Endurance!
11
• Codes aren t self explanatory
• Lack of experience in using core liibraries could
be pain
• Don t know what goes where.
12
Architecure is About Intent, not Frameworks
13
by Robert Cecil Martin
With the Hope, no one gives up architecting
14
How to use it (Tutorial)
15
Primitive App
16
• Single Activity
• Single List View
• Horizontally aligned texts
• Fab
• click and fetch data
• Fetch MusicList(data)
• by Retrofit
• freemusicarchive.org
• DI and EventHub
• Under Construction
Click And Fetch Data Tutorial
17
The Goal
18
• Click Fab
• Run Retrofit to fetch data
• Not considering data response
19
What We Will Implement
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Thing You Need To Implement
20
• MainActivity
• MusicListPresenter
• MusicListUseCase
• MusicListUseCaseImpl
• MusicListRepository
• MusicListRepositoryImpl
• MusicListEntity
Data
Domain
Presentation
Thing You Need To Implement
21
• MainActivity
• MusicListAdapter
• MusicListPresenter
• MusicListUseCase
• MusicListUseCaseImpl
• MusicListRepository
• MusicListRepositoryImpl
• MusicListEntity
Presentation - UserAction
22
• Main Activity & MusicListAdapter
• Render List View attaching adapter
• Initialize followings
• repository, usecase, presenter
• Pass FAB clicked event along with Main Thread Info
to Presenter
• MusicListPresenter
• Receive FAB clicked event from View
• Execute MusicListUseCase(Imp) Job
• Pass thread info to MusicListUseCas(Imp)
23
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Domain - User Action to Data Interface
24
• MusicUseCase
• Provide interface between Domain Layer &
Presentation Layer
• MusicUseCaseImp
• Ask MusicListRepository(Imp) for API(External
Resource)
• MusicListRepository
• Provide interface between Domain Layer &
Data Layer
25
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Data - Data Interface to DataSource
26
• MusicListRepositoryImp
• To Fetch external Data
• Declare and Execute Retrofit Http Client
• GET http://freemusicarchive.org/api?
key={key}
• MusicListEntity
• Parse Response and map to domain/model
• gson will handle it.
27
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
That s it for Fetching Data
28
Now we want to Reflect Data
Reflect Data to View Tutorial
29
The Goal
30
• Pass back data just fetched
• Update View
31
What We Will Implement
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Thing You Need To Implement
32
• MusicListRepository#MusicListFetchCallback
• MusicListUseCaseImpl
• MusicListUseCase#MusicListUseCaseCallback
• MusicListPresenter
• MusicListPresenter#MusicListViewCallback
• MainActivity
Presentation
Domain
Data
Thing You Need To Implement
33
• MusicListRepository#MusicListFetchCallback
• MusicListUseCaseImpl
• MusicListUseCase#MusicListUseCaseCallback
• MusicListPresenter
• MusicListPresenter#MusicListViewCallback
• MainActivity
Domain - Passing Data to User Interface
34
• MusicListRepository#MusicListFetchCallback
• MusicListUseCaseImpl
• Implement MusicListFetchCallback
• So that Main Threat can receive runnable
with command with fetched data
• MusicListUseCase#MusicListUseCaseCallback
• MusicListPresenter
• MusicListPresenter#MusicListViewCallback
• MainActivity
35
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
Presentation - Updating View
36
• MusicListUseCase#MusicListUseCaseCallback
• MusicListPresenter#MusicListViewCallback
• MusicListPresenter
• Implement MusicListUseCaseCallback
• Execute methods in MusicListViewCallback
• MainActivity
• Implement MusicListViewCallback
• So that User Case can pass fetched data
• So that Activity can update adapter data
37
What We Just Implemented
• reference
• Architecting Android…The Clean Way?:
• これからの設計の話をしよう
That s it!
38
Lots of Room for Improvement
39
• Callback Repetition is quite Ugly
• Many Reinvent Wheel
• Not using Dagger, RxJava
• Not a big fun of passing thread around
• Tutorial itself wasn t thoroughly covered
Still, Worthwhile
40
Especially, in the team
Enjoy Clean Architecting!
41
Thank you!
References
43
• English
• Architecting Android…The Clean Way?: http://fernandocejas.com/
2014/09/03/architecting-android-the-clean-way/
• Clean Android Architecture: https://speakerdeck.com/richk/clean-
android-architecture
• MVP for Android: how to organize presentation layer: http://
antonioleiva.com/mvp-android/
• Japanese
• AndroidオールスターズでClean Architectureについて発表してきた: http://
tomoima525.hatenablog.com/entry/2015/08/13/190731
• これからの設計の話をしよう: http://www.slideshare.net/
shinnosukekugimiya/ss-50705888
• AndroidではMVCよりMVPの方がいいかもしれない: http://
konifar.hatenablog.com/entry/2015/04/17/010606

More Related Content

What's hot (20)

PDF
Microservice Stategies - Scaling your API design workflow
Jakub Nesetril
 
PPTX
Into to GraphQL
shobot
 
PDF
apidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflix
apidays
 
PDF
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum
 
PPTX
API-first development
Vasco Veloso
 
PDF
Standing out as a new grad candidate
Sashko Stubailo
 
PDF
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays
 
PPTX
Taking Control of your Data with GraphQL
Vinci Rufus
 
PDF
How to GraphQL
Tomasz Bak
 
PDF
Mikki Mesfin's Resume
Mikki Mesfin
 
PPTX
Blood, sweat, and creating an API handbook
Pronovix
 
PDF
apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...
apidays
 
PDF
Api First Design
Klaus Peter Laube
 
PDF
SauceCon19: Fashionable XCUITest for iOS App
Shashikant Jagtap
 
PDF
GraphQL vs BFF: A critical perspective
Pronovix
 
PDF
API first approach for frontend developers
FDConf
 
PPTX
Writing Slack Bots in JavaScript
Niklas Heidloff
 
PDF
[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...
CocoaHeads Tricity
 
PPTX
Pure APIs: Development workflows for successful API integrations
José Haro Peralta
 
PPTX
Open Event API
Avi Aryan
 
Microservice Stategies - Scaling your API design workflow
Jakub Nesetril
 
Into to GraphQL
shobot
 
apidays LIVE Hong Kong 2021 - Less Data is More by Damir Svrtan, Netflix
apidays
 
Infinum Android Talks #13 - Developing Android Apps Like Navy Seals by Ivan Kušt
Infinum
 
API-first development
Vasco Veloso
 
Standing out as a new grad candidate
Sashko Stubailo
 
apidays LIVE London 2021 - API Horror Stories from an Unnamed Coworking Compa...
apidays
 
Taking Control of your Data with GraphQL
Vinci Rufus
 
How to GraphQL
Tomasz Bak
 
Mikki Mesfin's Resume
Mikki Mesfin
 
Blood, sweat, and creating an API handbook
Pronovix
 
apidays LIVE Australia 2021 - Designing APIs: Just Enough is Perfect! by Dami...
apidays
 
Api First Design
Klaus Peter Laube
 
SauceCon19: Fashionable XCUITest for iOS App
Shashikant Jagtap
 
GraphQL vs BFF: A critical perspective
Pronovix
 
API first approach for frontend developers
FDConf
 
Writing Slack Bots in JavaScript
Niklas Heidloff
 
[CocoaHeads Tricity] Andrzej Dąbrowski - Dependency injection and testable ar...
CocoaHeads Tricity
 
Pure APIs: Development workflows for successful API integrations
José Haro Peralta
 
Open Event API
Avi Aryan
 

Viewers also liked (20)

PDF
Clean architecture: Android
intive
 
PPTX
Clean architecture on android
Benjamin Cheng
 
PDF
Effective Android UI - English
Pedro Vicente Gómez Sánchez
 
PDF
Android cleanarchitecture
Tomoaki Imai
 
PDF
Clean Architecture
Badoo
 
PPT
Design pattern in android
Jay Kumarr
 
PDF
Is Activity God? ~ The MVP Architecture ~
Ken William
 
PDF
Introducing Clean Architecture
Roc Boronat
 
PPTX
Clean architecture
andbed
 
PPTX
Android Design Principles and Popular Patterns
Faiz Malkani
 
PDF
Karumi Dojo: Kata Maxibon
Pedro Vicente Gómez Sánchez
 
PDF
Android DevConference - Android Clean Architecture
iMasters
 
PPTX
Lightning Talk - Clean Architecture and Design
Deivison Sporteman
 
PDF
Dependency injection on Android
Pedro Vicente Gómez Sánchez
 
PDF
My way to clean android v2 English DroidCon Spain
Christian Panadero
 
PPTX
Onion Architecture
matthidinger
 
PDF
World-Class Testing Development Pipeline for Android
Pedro Vicente Gómez Sánchez
 
PDF
Real Life Clean Architecture
Mattia Battiston
 
PDF
Software Design patterns on Android English
Pedro Vicente Gómez Sánchez
 
PDF
Upload a screenshot to Slack
Shinobu Okano
 
Clean architecture: Android
intive
 
Clean architecture on android
Benjamin Cheng
 
Effective Android UI - English
Pedro Vicente Gómez Sánchez
 
Android cleanarchitecture
Tomoaki Imai
 
Clean Architecture
Badoo
 
Design pattern in android
Jay Kumarr
 
Is Activity God? ~ The MVP Architecture ~
Ken William
 
Introducing Clean Architecture
Roc Boronat
 
Clean architecture
andbed
 
Android Design Principles and Popular Patterns
Faiz Malkani
 
Karumi Dojo: Kata Maxibon
Pedro Vicente Gómez Sánchez
 
Android DevConference - Android Clean Architecture
iMasters
 
Lightning Talk - Clean Architecture and Design
Deivison Sporteman
 
Dependency injection on Android
Pedro Vicente Gómez Sánchez
 
My way to clean android v2 English DroidCon Spain
Christian Panadero
 
Onion Architecture
matthidinger
 
World-Class Testing Development Pipeline for Android
Pedro Vicente Gómez Sánchez
 
Real Life Clean Architecture
Mattia Battiston
 
Software Design patterns on Android English
Pedro Vicente Gómez Sánchez
 
Upload a screenshot to Slack
Shinobu Okano
 
Ad

Similar to Android Clean Architecture for Dummies (20)

PDF
Stuttgart Cloud-Native Landscape
VMware Tanzu
 
PDF
Cloud-Native Roadshow - Landscape - San Francisco
VMware Tanzu
 
PDF
Cloud-Native Roadshow - Landscape - Toronto
VMware Tanzu
 
PDF
Cloud-Native Roadshow - Landscape - St. Louis
VMware Tanzu
 
PDF
Munich Cloud-Native Landscape
VMware Tanzu
 
PDF
How We Fixed Our MongoDB Problems
MongoDB
 
PDF
Cloud-Native Roadshow - Landscape - London
VMware Tanzu
 
PDF
Landscape Cloud-Native Roadshow Los Angeles
VMware Tanzu
 
PDF
Cloud-Native Landscape (Chicago)
VMware Tanzu
 
PDF
Cloud-Native Workshop NYC - The Cloud-Native Landscape
VMware Tanzu
 
PDF
Cloud-Native Landscape
VMware Tanzu
 
PDF
Cloud-Native Roadshow - Landscape - Dallas
VMware Tanzu
 
PDF
Cloud-Native Roadshow - Landscape - Atlanta
VMware Tanzu
 
PDF
Cloud-Native Roadshow - Landscape - Detroit
VMware Tanzu
 
PDF
Cloud-Native Roadshow – Landscape – Amsterdam
VMware Tanzu
 
PDF
Cloud-Native Roadshow Boston
VMware Tanzu
 
PDF
Cloud-Native Roadshow - Landscape - DC
VMware Tanzu
 
PDF
Cloud-Native Roadshow - Landscape - Paris
VMware Tanzu
 
POTX
Thoughts on Component Resuse
Justin Edelson
 
PDF
Cloud-Native Roadshow - Landscape - Denver
VMware Tanzu
 
Stuttgart Cloud-Native Landscape
VMware Tanzu
 
Cloud-Native Roadshow - Landscape - San Francisco
VMware Tanzu
 
Cloud-Native Roadshow - Landscape - Toronto
VMware Tanzu
 
Cloud-Native Roadshow - Landscape - St. Louis
VMware Tanzu
 
Munich Cloud-Native Landscape
VMware Tanzu
 
How We Fixed Our MongoDB Problems
MongoDB
 
Cloud-Native Roadshow - Landscape - London
VMware Tanzu
 
Landscape Cloud-Native Roadshow Los Angeles
VMware Tanzu
 
Cloud-Native Landscape (Chicago)
VMware Tanzu
 
Cloud-Native Workshop NYC - The Cloud-Native Landscape
VMware Tanzu
 
Cloud-Native Landscape
VMware Tanzu
 
Cloud-Native Roadshow - Landscape - Dallas
VMware Tanzu
 
Cloud-Native Roadshow - Landscape - Atlanta
VMware Tanzu
 
Cloud-Native Roadshow - Landscape - Detroit
VMware Tanzu
 
Cloud-Native Roadshow – Landscape – Amsterdam
VMware Tanzu
 
Cloud-Native Roadshow Boston
VMware Tanzu
 
Cloud-Native Roadshow - Landscape - DC
VMware Tanzu
 
Cloud-Native Roadshow - Landscape - Paris
VMware Tanzu
 
Thoughts on Component Resuse
Justin Edelson
 
Cloud-Native Roadshow - Landscape - Denver
VMware Tanzu
 
Ad

More from Kengo Suzuki (6)

PDF
Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)
Kengo Suzuki
 
PDF
第二回Android training4desinger 2
Kengo Suzuki
 
PDF
第一回Android training4desinger
Kengo Suzuki
 
PDF
Android Pen Test - Recon -
Kengo Suzuki
 
PDF
iOSアプリエンジニアの最近
Kengo Suzuki
 
PDF
俺が! 俺たちが! Androidチームだ!
Kengo Suzuki
 
Androidのセキュア開発について考えてみた(明日、敗訴しないためのセキュアコーディング.ver2)
Kengo Suzuki
 
第二回Android training4desinger 2
Kengo Suzuki
 
第一回Android training4desinger
Kengo Suzuki
 
Android Pen Test - Recon -
Kengo Suzuki
 
iOSアプリエンジニアの最近
Kengo Suzuki
 
俺が! 俺たちが! Androidチームだ!
Kengo Suzuki
 

Recently uploaded (20)

PDF
How to Buy Verified CashApp Accounts IN 2025
Buy Verified CashApp Accounts
 
PDF
bs-en-12390-3 testing hardened concrete.pdf
ADVANCEDCONSTRUCTION
 
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
PPTX
Artificial Intelligence jejeiejj3iriejrjifirirjdjeie
VikingsGaming2
 
PPTX
CST413 KTU S7 CSE Machine Learning Introduction Parameter Estimation MLE MAP ...
resming1
 
PPTX
Computer network Computer network Computer network Computer network
Shrikant317689
 
PPTX
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
PDF
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
PPTX
Precooling and Refrigerated storage.pptx
ThongamSunita
 
PPSX
OOPS Concepts in Python and Exception Handling
Dr. A. B. Shinde
 
PPT
دراسة حاله لقرية تقع في جنوب غرب السودان
محمد قصص فتوتة
 
PDF
PRIZ Academy - Process functional modelling
PRIZ Guru
 
PDF
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
PPTX
Functions in Python Programming Language
BeulahS2
 
PDF
LLC CM NCP1399 SIMPLIS MODEL MANUAL.PDF
ssuser1be9ce
 
PPTX
Kel.3_A_Review_on_Internet_of_Things_for_Defense_v3.pptx
Endang Saefullah
 
PDF
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
PDF
Tesia Dobrydnia - An Avid Hiker And Backpacker
Tesia Dobrydnia
 
PPT
SF 9_Unit 1.ppt software engineering ppt
AmarrKannthh
 
PPTX
Work at Height training for workers .pptx
cecos12
 
How to Buy Verified CashApp Accounts IN 2025
Buy Verified CashApp Accounts
 
bs-en-12390-3 testing hardened concrete.pdf
ADVANCEDCONSTRUCTION
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
Artificial Intelligence jejeiejj3iriejrjifirirjdjeie
VikingsGaming2
 
CST413 KTU S7 CSE Machine Learning Introduction Parameter Estimation MLE MAP ...
resming1
 
Computer network Computer network Computer network Computer network
Shrikant317689
 
FSE_LLM4SE1_A Tool for In-depth Analysis of Code Execution Reasoning of Large...
cl144
 
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
Precooling and Refrigerated storage.pptx
ThongamSunita
 
OOPS Concepts in Python and Exception Handling
Dr. A. B. Shinde
 
دراسة حاله لقرية تقع في جنوب غرب السودان
محمد قصص فتوتة
 
PRIZ Academy - Process functional modelling
PRIZ Guru
 
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
Functions in Python Programming Language
BeulahS2
 
LLC CM NCP1399 SIMPLIS MODEL MANUAL.PDF
ssuser1be9ce
 
Kel.3_A_Review_on_Internet_of_Things_for_Defense_v3.pptx
Endang Saefullah
 
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
Tesia Dobrydnia - An Avid Hiker And Backpacker
Tesia Dobrydnia
 
SF 9_Unit 1.ppt software engineering ppt
AmarrKannthh
 
Work at Height training for workers .pptx
cecos12
 

Android Clean Architecture for Dummies

  • 3. Self Introduction name: Kengo Suzuki twitter: @kengoScal 3 2011∼2014:Security Analyst 2014年11月: Joined MoneyForward 2014年11月∼2015年01月: iOS 2015年02月∼08月:Android 2015年09月∼10月 : Security Architect 2015年11月 : Security Architect/Management + Android
  • 4. 4 In Charge of New Android App!
  • 6. What is it & Why using it? 6
  • 7. What is it & Why using it? 7 Not Today.
  • 8. Plenty of Good Entries(with source codes) 8 • English • Architecting Android…The Clean Way? • Clean Android Architecture • MVP for Android: how to organize presentation layer • Japanese • AndroidオールスターズでClean Architectureについて発 表してきた • これからの設計の話をしよう • AndroidではMVCよりMVPの方がいいかもしれない
  • 9. Plenty of Good Entries(with source codes) 9 • English • Architecting Android…The Clean Way? • Clean Android Architecture • MVP for Android: how to organize presentation layer • Japanese • AndroidオールスターズでClean Architectureについ て発表してきた • これからの設計の話をしよう • AndroidではMVCよりMVPの方がいいかもしれない Big Picture Source Code Roles Big Picture Roles Presenter
  • 10. Right off the Bat? 10 訳: すぐに/直ちに
  • 11. Need Endurance! 11 • Codes aren t self explanatory • Lack of experience in using core liibraries could be pain • Don t know what goes where.
  • 12. 12
  • 13. Architecure is About Intent, not Frameworks 13 by Robert Cecil Martin
  • 14. With the Hope, no one gives up architecting 14
  • 15. How to use it (Tutorial) 15
  • 16. Primitive App 16 • Single Activity • Single List View • Horizontally aligned texts • Fab • click and fetch data • Fetch MusicList(data) • by Retrofit • freemusicarchive.org • DI and EventHub • Under Construction
  • 17. Click And Fetch Data Tutorial 17
  • 18. The Goal 18 • Click Fab • Run Retrofit to fetch data • Not considering data response
  • 19. 19 What We Will Implement • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 20. Thing You Need To Implement 20 • MainActivity • MusicListPresenter • MusicListUseCase • MusicListUseCaseImpl • MusicListRepository • MusicListRepositoryImpl • MusicListEntity
  • 21. Data Domain Presentation Thing You Need To Implement 21 • MainActivity • MusicListAdapter • MusicListPresenter • MusicListUseCase • MusicListUseCaseImpl • MusicListRepository • MusicListRepositoryImpl • MusicListEntity
  • 22. Presentation - UserAction 22 • Main Activity & MusicListAdapter • Render List View attaching adapter • Initialize followings • repository, usecase, presenter • Pass FAB clicked event along with Main Thread Info to Presenter • MusicListPresenter • Receive FAB clicked event from View • Execute MusicListUseCase(Imp) Job • Pass thread info to MusicListUseCas(Imp)
  • 23. 23 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 24. Domain - User Action to Data Interface 24 • MusicUseCase • Provide interface between Domain Layer & Presentation Layer • MusicUseCaseImp • Ask MusicListRepository(Imp) for API(External Resource) • MusicListRepository • Provide interface between Domain Layer & Data Layer
  • 25. 25 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 26. Data - Data Interface to DataSource 26 • MusicListRepositoryImp • To Fetch external Data • Declare and Execute Retrofit Http Client • GET http://freemusicarchive.org/api? key={key} • MusicListEntity • Parse Response and map to domain/model • gson will handle it.
  • 27. 27 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 28. That s it for Fetching Data 28 Now we want to Reflect Data
  • 29. Reflect Data to View Tutorial 29
  • 30. The Goal 30 • Pass back data just fetched • Update View
  • 31. 31 What We Will Implement • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 32. Thing You Need To Implement 32 • MusicListRepository#MusicListFetchCallback • MusicListUseCaseImpl • MusicListUseCase#MusicListUseCaseCallback • MusicListPresenter • MusicListPresenter#MusicListViewCallback • MainActivity
  • 33. Presentation Domain Data Thing You Need To Implement 33 • MusicListRepository#MusicListFetchCallback • MusicListUseCaseImpl • MusicListUseCase#MusicListUseCaseCallback • MusicListPresenter • MusicListPresenter#MusicListViewCallback • MainActivity
  • 34. Domain - Passing Data to User Interface 34 • MusicListRepository#MusicListFetchCallback • MusicListUseCaseImpl • Implement MusicListFetchCallback • So that Main Threat can receive runnable with command with fetched data • MusicListUseCase#MusicListUseCaseCallback • MusicListPresenter • MusicListPresenter#MusicListViewCallback • MainActivity
  • 35. 35 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 36. Presentation - Updating View 36 • MusicListUseCase#MusicListUseCaseCallback • MusicListPresenter#MusicListViewCallback • MusicListPresenter • Implement MusicListUseCaseCallback • Execute methods in MusicListViewCallback • MainActivity • Implement MusicListViewCallback • So that User Case can pass fetched data • So that Activity can update adapter data
  • 37. 37 What We Just Implemented • reference • Architecting Android…The Clean Way?: • これからの設計の話をしよう
  • 39. Lots of Room for Improvement 39 • Callback Repetition is quite Ugly • Many Reinvent Wheel • Not using Dagger, RxJava • Not a big fun of passing thread around • Tutorial itself wasn t thoroughly covered
  • 43. References 43 • English • Architecting Android…The Clean Way?: http://fernandocejas.com/ 2014/09/03/architecting-android-the-clean-way/ • Clean Android Architecture: https://speakerdeck.com/richk/clean- android-architecture • MVP for Android: how to organize presentation layer: http:// antonioleiva.com/mvp-android/ • Japanese • AndroidオールスターズでClean Architectureについて発表してきた: http:// tomoima525.hatenablog.com/entry/2015/08/13/190731 • これからの設計の話をしよう: http://www.slideshare.net/ shinnosukekugimiya/ss-50705888 • AndroidではMVCよりMVPの方がいいかもしれない: http:// konifar.hatenablog.com/entry/2015/04/17/010606