Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MVP on Android: why do you need it?
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Stan Kocken
May 02, 2016
Programming
190
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MVP on Android: why do you need it?
Stan Kocken
May 02, 2016
More Decks by Stan Kocken
See All by Stan Kocken
Remote Control your App
stankocken
3
500
Unit Test your code, even your UI
stankocken
1
310
EfficientAdapter
stankocken
1
120
Other Decks in Programming
See All in Programming
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
400
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
160
今さら聞けない .NET CLI
htkym
0
190
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
200
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
250
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
680
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
390
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
500
「人を評価する AI」の設計と実装
ryoyanara
0
190
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
210
AIが無かった頃の素敵な出会いの話
codmoninc
1
420
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
What's in a price? How to price your products and services
michaelherold
247
13k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
400
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
380
Ethics towards AI in product and experience design
skipperchong
2
340
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
760
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Producing Creativity
orderedlist
PRO
348
40k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
210
Music & Morning Musume
bryan
47
7.3k
Transcript
MVP: why do you need it? @stan_kocken
Join our team! dashlane.com/jobs Never forget another password Editor Choice
Top Developer 4.5/5 - 1M+ downloads
MVP: why do you need it?
Activity
BaseActivity: 1600+ lines A base activity that handles common functionality
in the app. This includes the navigation drawer, login and authentication, Action Bar tweaks, amongst others.
God Object
Activity
Activity/Fragments Usually contain: - actions on View - handle clicks
- read/write in database / SharePreference - network calls - …
Activity/Fragments Very hard to: - read - test - refactor
- reuse code - …
Separation of Concerns
Architecture MVP Model View Presenter state-change events updates view update
model user events
Architecture MVP: in Android, my way Model View Presenter
Architecture MVP: in Android, my way Model: access data store
state View Presenter
Architecture MVP: in Android, my way Model: access data store
state View Presenter: present data to UI
Architecture MVP: in Android, my way Model: access data store
state View: touch Android View no business logic Presenter: present data to UI
Architecture MVP: in Android, my way View: touch Android View
no business logic Presenter: present data to UI Model: DataProvider access data store state
Architecture MVP: in Android, my way Model: DataProvider access data
store state View: ViewProxy touch Android View no business logic Presenter: present data to UI
Presenter DataProvider ViewProxy Activity View Strong Reference Weak Reference Other
“Strong” Reference on DataProvider, Presenter or ViewProxy forbidden. Use WeakReference. Architecture MVP: in Android, my way
Example
DataProvider Presenter ViewProxy Creation refreshBoard() getGameBoard() setBoxValue( int x, int
y, int boxType);
DataProvider Presenter ViewProxy User click box onSelectBox(int x, int y)
play(int x, int y) refreshBoard() …
Definition public interface BoardDef { interface IPresenter extends BaseDef.IPresenter
{ void refreshBoard(); void onSelectBox(int x, int y); } interface IDataProvider extends BaseDef.IDataProvider { GameBoard getGameBoard(); void play(int x, int y); } interface IView extends BaseDef.IView { void setBoxValue(int x, int y, int boxType); } }
Test the UI Android stuffs TextView ImageView … View Proxy
Already Tested by framework team
Test the UI View Proxy Mock Mock Mock
@stan_kocken Presentation pattern: github.com/StanKocken/Presentation TicTacToe Example: github.com/StanKocken/TicTacToe