Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
MVP on Android: why do you need it?
Search
Stan Kocken
May 02, 2016
Programming
200
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
510
Unit Test your code, even your UI
stankocken
1
320
EfficientAdapter
stankocken
1
120
Other Decks in Programming
See All in Programming
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
290
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
270
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.4k
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
5
3.8k
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
480
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
wkhtmltopdfの次どうするか問題2026
willnet
2
1.6k
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
130
速習iPhone Duo対応
yuukiw00w
1
700
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
510
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
130
Heart of Swift Concurrency
koher
0
940
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
320
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Practical Orchestrator
shlominoach
192
12k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
The Pragmatic Product Professional
lauravandoore
37
7.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Google's AI Overviews - The New Search
badams
0
1.6k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Test your architecture with Archunit
thirion
2
2.4k
Mobile First: as difficult as doing things right
swwweet
225
10k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
680
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